Hi guys

Following Code doesn't work for me, what am I doing wrong?

$criteria=new CDbCriteria;

$criteria->condition = "`state` IN (:state)";

$criteria->params = array(':state'=>"'1','0'");

shouldn't the code fire a sql query like this ?

SELECT * FROM *** WHERE state IN ('0', '1') 

It just don't get both states

Thank you for help


In my opinion it’s because quotes get applied before params are binded. Give it a try to pass the array directly.

thought i tried it like this but it works :)

I can live with it, thank you