This question already has an answer here:
- Yii CDbCommand create query 1 answer
Does anybody know how to use the andWhere() condition in yii. I'm getting the below error when i use it.
CDbCommand and its behaviors do not have a method or closure named "andWhere".
here is sample code
$result=Yii::app()->db->createCommand()
->select()
->from('{{product}}')
->andWhere('price>:param1', array(':param1'=>150))
->andWhere('price<:param2', array(':param2'=>210))
->queryAll();
</div>