Answer the question
In order to leave comments, you need to log in
Is it possible to pass a parameter to CDBCriteria->addInCondition via a placeholder?
Good evening.
I'm trying to create a query with an IN condition using ActiveRecord. Did it like this:
$criteria = new CDbCriteria();
$criteria->select = 'alias';
$criteria->addInCondition('id', $ids); // $ids - массив с ID
$criteria = new CDbCriteria();
$criteria->select = 'alias';
$criteria->addInCondition('id', ':ids');
$criteria->params = [
':ids' => $ids
];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question