dongshi1188 2013-02-21 06:13
浏览 24
已采纳

如何使用和Yii [重复]

This question already has an answer here:

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>
  • 写回答

2条回答 默认 最新

  • dtt3399 2013-02-21 06:21
    关注

    The andWhere() function is added in yii 1.1.13. It seems you are using older version of yii. Update the framework

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部