Jump to content


Dropdown issue

dropdown

  • Please log in to reply
1 reply to this topic

#1 joeinatlanta

joeinatlanta

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 13 June 2016 - 11:56 PM

I have searched this forum for a simple answer and have had no luck.  I know you can build table relationships.  In my case, I have the following:

 

Table Company : Fields companyId and  companyName

Table Salesperson:  Fields companyRef and spName

 

I set relation:  $crud->set_relation('companyRef','Company','companyID')

 

First, how can I view the companyName.  And second, when I attempt to edit, I want to have a companyName dropdown but update the companyId field when done.

 

Please, don't send me to view set_relation topic.  I have read it and it does not apply to my needs.  

 

Joe

 

 



#2 joeinatlanta

joeinatlanta

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 14 June 2016 - 12:17 AM

Sooo, I found the answer to my own question.  I guess my only question would be, when you set the relation you specify your foreign key and your parent table.  How does it know which field to use as the primary key?  Joe







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users