How to create WHERE IN clause with Zend_Db_Select

前端 未结 6 1476
-上瘾入骨i
-上瘾入骨i 2021-02-01 00:27

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

6条回答
  •  抹茶落季
    2021-02-01 00:44

    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

提交回复
热议问题