How build this query with YIi query builder
SELECT *
FROM `table`
WHERE type_item = 2 AND name_item LIke '%name%'
I tried so
return Yii::app()->db->createCommand()
->select('*')
->from('{{event_field_variants}}')
->where('type_item = :type AND name_item LIKE "%:substr%"', array(':type' => '2', ':substr' => 'name'))
->order('variant ASC')
->queryAll();
But this query get CdbcException.
On Yii documentation are examples only with like or only with simple param.
Just put it in the variables part?