⚠ 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

Multiple set_relation within the same table or different ones



kuduka
  • profile picture
  • Member

Posted 14 January 2018 - 18:38 PM

Hello,

 

 

How can I use multiple set_relation with the same field_name? This is not working:

 

        $crud->set_relation('cityid','pc','postalcode');
        $crud->set_relation('cityid','cities','cityname');
 

Thanks for your help.

 


darkstalker
  • profile picture
  • Member

Posted 14 January 2018 - 19:56 PM

You need to change first field name. Use cityid_pc and cityid_cities for example

kuduka
  • profile picture
  • Member

Posted 15 January 2018 - 15:06 PM

You need to change first field name. Use cityid_pc and cityid_cities for example

I can't use different fields as I only have one FK (cityid) that relates both tables.

Any other ideas?