Blogger Information
Blog 43
fans 0
comment 3
visits 26537
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
thinkphp 数据没有变化也执行update
Time
Original
898 people have browsed it

原本的判断:

  1. $result = $Model->where('id=1')->save($data);
  2. if($result) {
  3. echo 'success';
  4. }else{
  5. echo 'false';
  6. }

解决办法: 使用“===”判断返回值即可

  1. $result = $Model->where('id=1')->save($data);
  2. if($result !== false) {
  3. echo 'success';
  4. }else{
  5. echo 'false';
  6. }
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!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!