i am doing an SQL result filtering class. i need help to use IN condition mixed with other AND condition in WHERE.
I putting IN condition in string…
the result is
SELECT *
FROM table
WHERE a.user_id
IN (:user)
Bound with :user=‘147,148,149’
this dont work.
i saw this http://www.yiiframework.com/doc/guide/1.1/en/database.query-builder
i know it is telling me to do in Array way.
->where(array(‘in’, ‘user_id’, array(1, 2,3))
but my class need to construct the query string and query param dynamic. there will mix with other AND condition such as date range… can anyone tell me how to do IN condition with query builder in STRING? instead of ARRAY