是否有人知道如何在yii中使用andWhere()條件。當我使用它時,出現以下錯誤。如何在Yii中使用和在哪裏
CDbCommand and its behaviors do not have a method or closure named "andWhere".
這裏是示例代碼
$result=Yii::app()->db->createCommand()
->select()
->from('{{product}}')
->andWhere('price>:param1', array(':param1'=>150))
->andWhere('price<:param2', array(':param2'=>210))
->queryAll();
你可以在你想要使用它的地方添加代碼片段嗎? – cdmckay 2013-02-21 14:13:57
是的,我添加了一些示例代碼 – 2013-02-21 14:18:29