Jump to content


Set relation between multiple tables

set_relation join foreign_key

  • Please log in to reply
1 reply to this topic

#1 Racing Chocobo

Racing Chocobo

    Member

  • Members
  • PipPip
  • 28 posts

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)

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^^



#2 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,099 posts
  • LocationLondon

Posted 17 January 2017 - 04:35 PM

This is actually the relation_n_n :)  You can find all the details here: http://www.grocerycr...et_relation_n_n


Posted Image





Also tagged with one or more of these keywords: set_relation, join, foreign_key

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users