tp5.0中更新数据的两种写法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_31879707/article/details/85015120
1、使用save保存一定要加上allowField,不然保存不成功。
$result = $this->allowField(true)->save($data,$where);
2、update更新的写法
$result = $this->where($where)->update($data);

猜你喜欢

转载自blog.csdn.net/qq_31879707/article/details/85015120
今日推荐