views:

957

answers:

2

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?

+2  A: 

apparently it is super simple... stupid me:

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

:(

xelurg
Yes, that's right.
Bill Karwin
+9  A: 

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

harvejs
Googled this problem and found your solution - then realized I had already upvoted it once. So since I can't upvote you again, take this comment as my token of appreciation!
leek
great, many thanks :)
harvejs
So many variations on paramaterizing INs, thanks for saving my an evening of using google glopping!
Alan Storm