Yii中andWhere的使用方法 [英] How to use andWhere in Yii

查看:30
本文介绍了Yii中andWhere的使用方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何在 yii.js 中使用 andWhere() 条件?使用时出现以下错误.

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". 

这里是示例代码

 $result=Yii::app()->db->createCommand()
->select()
->from('{{product}}')
->andWhere('price>:param1', array(':param1'=>150))
->andWhere('price<:param2', array(':param2'=>210))
->queryAll();

推荐答案

andWhere() 函数是在 yii 1.1.13 中添加的.看来您使用的是旧版本的 yii.更新框架

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

这篇关于Yii中andWhere的使用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆