信息发布→ 登录 注册 退出

yii如何更新数据库数据

发布时间:2020-02-17

点击量:

yii更新数据库数据的方法如下:

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']);

更多编程相关内容学习,请访问编程教程栏目!

标签:# yii  # 相关内容  # 方法如下  # toolbar  # false  # php  # Customer  # img  # src  # updateAll  # st  
在线客服
服务热线

服务热线

4008888355

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

打开微信

微信号已复制,请打开微信添加咨询详情!