⚠ 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 > / <



R2D2

R2D2
  • profile picture
  • Member

Posted 27 April 2012 - 16:15 PM

Hi again,

I think the title is quite obvious,
is it possible to set bigger/less than clauses in the where statement?


$crud->where('status','active'); // status > 2 or < 5 etc. possible?


Thanks,

R2D2

KaBaDaBrA

KaBaDaBrA
  • profile picture
  • Member

Posted 27 April 2012 - 16:31 PM

try


$crud->where('status >','2')->where('status <','5');


or something like


$where = "status > '2' AND status < '5'";

$crud->where($where);

R2D2

R2D2
  • profile picture
  • Member

Posted 27 April 2012 - 16:40 PM

Thanks a lot!

the first one didn't work, but it worked when i seperated it in 2 where-lines

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 27 April 2012 - 18:50 PM

You can also do:


$crud->where(array('status >' => '2', 'status <' => '5'));