原本的判断:
$result = $Model->where('id=1')->save($data);
if($result) {
echo 'success';
}else{
echo 'false';
}
解决办法: 使用“===”判断返回值即可
$result = $Model->where('id=1')->save($data);
if($result !== false) {
echo 'success';
}else{
echo 'false';
}
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!