yii更新數(shù)據(jù)庫數(shù)據(jù)的方法如下:
Customer::updateAll(['status'?=>?1],?['status'=>?'2','uid'=>'1']);
等價于:
(推薦教程:yii框架)
update?customer?set?status?=?1?where?status?=?2?and?uid?=?1;
注意:不能寫成如下形式:
Customer::find()->?updateAll(['status'?=>?1],?['status'=>?'2','uid'=>'1']);
更多編程相關(guān)內(nèi)容學(xué)習(xí),請?jiān)L問php中文網(wǎng)yii框架欄目!
? 版權(quán)聲明
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載。
THE END