⚠ 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

How to limit dropdown out when using set_relation



CharleSven

CharleSven
  • profile picture
  • Member

Posted 13 April 2015 - 07:38 AM

If I used $crud->set_relation(), in my edit or add page the dropdown will output the entire record of my table.

 

Is there a way to limit the result set of this dropdown tag?


CharleSven

CharleSven
  • profile picture
  • Member

Posted 05 May 2015 - 10:16 AM

You can also have a where clause at the 4th parameter (is not a required parameter). For example:

 
$crud->set_relation('user_id','users','username',array('status' => 'active'));