所以这是:
....AND (c.user_id NOT IN ('2,1'))
所以我想删除NOT IN (2,1)
->where("c.user_id NOT IN (?)",$not_in)
有没有办法获得这样的输出? NOT IN (2,1)
答案 0 :(得分:0)
您需要传递数组,而不是字符串
->where("c.user_id NOT IN (?)", $not_in_array)
如果你只有一个字符串 - explode()
:
$not_in_array = explode(',', $not_in);
答案 1 :(得分:0)
像这样解决:
->where("c.user_id NOT IN (?)",new Zend_Db_Expr($exclude))