⚠ 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

Set relation between multiple tables



Racing Chocobo

Racing Chocobo
  • profile picture
  • Member

Posted 03 November 2013 - 05:22 AM

Hi, I'm trying to find out how to do this join relation using grocery crud

I've three tables, 'inventory', 'item', 'item_name'

(below is the database schema)

[attachment=705:db.PNG]

 

What I'm trying to implement is when I want to add a record or browse all of the record in the inventory, I can get the "name" of the item from item_name table

 

So when I'm adding new record of the inventory, the field item of this can become dropdown list and the list option is the name of the item, not the item.id

 

If I use the set_relation(item, item, id), I can only get the id of the item instead of the name of the item

I donno how to make another set_relation to the third table (ItemName) using grocery_crud.

 

Any solution about this question?

 

Thank you very much^^


web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 17 January 2017 - 16:35 PM

This is actually the relation_n_n :)  You can find all the details here: http://www.grocerycrud.com/documentation/options_functions/set_relation_n_n