I've tried to get rows from table according to my conditions. My code:
$conditions = array(
'id' => array ('148028','118508')
);
$criteria = new CDbCriteria();
foreach($conditions as $key => $values){
$criteria->addInCondition($key, $values);
}
if(!is_null($limit)) $criteria->limit = $limit;
$rows = Item::model()->findAll($criteria);
These rows exist,but result is empty. Binding params exist in criteria object.
Log looks like:
system.db.CDbCommand.query(SELECT * FROM `items` `t` WHERE id IN (:ycp0, :ycp1) LIMIT 2)
i think, that params in criteria dont bind to a query.
Is my code right?