- 在mysql 修改save() 方法:数据改变修改成功返回1, 数据未改变修改成功返回0, 修改失败返回false;
- 代码如下
$res = M(“PerMent”)->where(“court_id = {$_POST[‘court_id’]} and delete_sign = 0 and left(update_time, 7) = ‘{$date}’”)->save($data);
//echo D(“PerMent”)->_sql();die;
if ($res === false) {
$this->errorWithLog($log,’目标值修改失败!’);
}elseif($res === 0){
$this->successWithLog($log,’未修改!’);
}else{
$this->successWithLog($log,’修改成功!’);
}
mysql save() 返回值,三种状态
最新推荐文章于 2021-11-15 15:26:47 发布