您好,欢迎访问一九零五行业门户网

ON UPDATE CURRENT_TIMESTAMP 无效

mysql updatetime 字段设置了 on update current_timestamp
但是在执行update操作后数据库中的时间还是添加时候的时间 可能是何中情况造成的呢?
public function updateinfo($cid,$data){ $this->db->set($data); $this->db->where('cid',$cid); if($this->db->update('report')){ return true; } else { return false; } }

回复内容: mysql updatetime 字段设置了 on update current_timestamp
但是在执行update操作后数据库中的时间还是添加时候的时间 可能是何中情况造成的呢?
public function updateinfo($cid,$data){ $this->db->set($data); $this->db->where('cid',$cid); if($this->db->update('report')){ return true; } else { return false; } }

可能是你本次update的数据跟数据库表数据完全一致,affected rows可能为0.
其它类似信息

推荐信息