I have a scenario where i have to get the values from some table.
I used findbysql() to get all the values.
$result = Mymodel::model()->findAllBySql("SELECT * FROM `something` WHERE `IID` IN (:iids) and `Duration` < 24 and `RegID` = :regid and `GCID` = :gcid",array( ':iids'=>$value1 , ':regid' => $value2, ':gcid'=>$value3));
and my variable holding the values such
$value1 = 2,3;
$value2 = 2,
$value3 = 5,
everything works cool as i expected. Except for one thing. when the $value1 is replaced in :iids it should check for both the values like 2 or 3. But the query always executed for the first value.
when the $value1 is 2,3 am getting the results only to 2 not for 3 then, if the $value1 is 3,4 then i am getting the results only to 3 not for 4.