Home > Article > Backend Development > ON UPDATE CURRENT_TIMESTAMP is invalid
MYSQL updatetime
The field is set to ON UPDATE CURRENT_TIMESTAMP
But after performing the UPDATE operation, the time in the database is still the time when it was added. What may be the cause?
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
The field is set to ON UPDATE CURRENT_TIMESTAMP
But after performing the UPDATE operation, the time in the database is still the time when it was added. What may be the cause?
public function updateInfo($cid,$data){
$this->db->set($data);
$this->db->where('cid',$cid);
if($this->db->update('report')){
return TRUE;
} else {
return FALSE;
}
}
It may be that the data in your update this time is completely consistent with the database table data, and the affected rows may be 0.