框架用的是Yii的1.1版本,
$count=EblsGoods::model()
->updateAll(
['Stock'=>100],'Id=:test1 and BeeGoodId=:test2',array(':test1'=>1,':test2'=>8)
);
更新数据库的条件是符合Id = 1 and BeeGoodId = 8 , 的Stock更改为100,但是一直会报语法错误, 请问是为什么?
CDbException: CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]:
Column not found: 1054 Unknown column '1 and BeeGoodId' in 'where clause'.
The SQL statement executed was: UPDATEyh_open_ebls_goods
SETStock
=:yp0 WHERE Id=:test1 and BeeGoodId=:test2. Bound with :yp0='100', :test1=1, :test2=8