How to create WHERE IN clause with Zend_Db_Select

Viewed 44377

So I am trying to accomplish something like this:

SELECT * FROM table WHERE status_id IN (1,3,4);

using Zend_Db_Select... can't find how to do it :( Is it at all possible?

6 Answers

you can also use it like this:

$data = array(1,3,4);
$select->where('status_id IN(?)', $data);

you dont need to implode array, and it's safer

apparently it is super simple... stupid me:

$select->where('status_id IN(1,3,4)');

:(

Related