⚠ 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

Where function



Robert
  • profile picture
  • Member

Posted 09 August 2013 - 12:50 PM

How exactly is the where function in GC working ?

i can use $crud->where('id','x'); but is there a way to add more values ? line x,y,z,k .... ?

 

 

 

 

Thanks

Robert


davidoster
  • profile picture
  • Member

Posted 09 August 2013 - 13:40 PM

No, you add multiple where functions,

$crud->where('x','y');

$crud->where('z','t');

$crud->where('q','p');


Robert
  • profile picture
  • Member

Posted 09 August 2013 - 13:59 PM

deleted


Robert
  • profile picture
  • Member

Posted 09 August 2013 - 13:59 PM

I have try that and it didnt work, that is way i asked.

 

if ($user->id == '17') {

$crud->where('field x','17');
$crud->where('field x','18');
$crud->where('field x','19');
}


davidoster
  • profile picture
  • Member

Posted 09 August 2013 - 14:41 PM

Use this technique,

$where = "name='Joe' AND status='boss' OR status='active'";
$crud->where($where);