⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Relation CRUD



Oleg Ponomarchuk

Oleg Ponomarchuk
  • profile picture
  • Member

Posted 03 October 2012 - 17:20 PM

Guys, I need your help, i can not create a relationship at CRUD. I want to keep SELECT list(HTML) of selected elements.
I have two tables:

[b]Menu[/b] and [b]Menu_title[/b]
They are linked by fields [b]Menu.id_menu[/b] = [b]Menu_title.id_menu[/b]

Have this code:
$ crud = new grocery_CRUD ();
$ crud-> set_table ('menu');


$ crud-> set_relation ('id_menu', 'menu_title', 'title');
$ crud-> display_as ('description', 'Summary');
$ crud-> set_relation ('id_menu', 'menu_title', 'title');


[b]where[/b]
$ crud-> set_relation ('id_menu', 'menu_title', 'title');
Documentation connects two tables by field id_menu with output from the second table of the field title. It seems true.

Here's an example in the documentation: http://www.grocerycrud.com/examples/set_a_relation
I have that does not work, time delivery of the project there are 2 hours - the resolution is not found ((