Search code examples
zend-frameworkzend-db

How to create WHERE IN clause with Zend_Db_Select


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?


Solution

  • 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