How to prevent mysql injection when using mysql IN clause without activeRecord in Yii?
问题 I have an array with ids that I get from client. And I want use those ids in my sql query with IN clause. But this query goes on a table that has no model. So there is no active record (criteria) query possible. ** Table userTasks ** -------------------- | idUser | idTasks | ---------+---------- | 1 | 1 | ---------+---------- | 1 | 2 | ---------+---------- | 1 | 3 | ---------+---------- First approach does not work because params are always considered as strings. So :tasks is a string '1,2,3'