Home > Backend Development > PHP Tutorial > ON UPDATE CURRENT_TIMESTAMP is invalid

ON UPDATE CURRENT_TIMESTAMP is invalid

WBOY
Release: 2016-08-04 09:21:26
Original
3817 people have browsed it

MYSQL updatetime The field is set to ON UPDATE CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP is invalid
But after performing the UPDATE operation, the time in the database is still the time when it was added. What may be the cause?

<code>public function updateInfo($cid,$data){
        $this->db->set($data);
        $this->db->where('cid',$cid);
        if($this->db->update('report')){
            return TRUE;
        } else {
            return FALSE;
        }
    }
</code>
Copy after login
Copy after login

Reply content:

MYSQL updatetime The field is set to ON UPDATE CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP is invalid
But after performing the UPDATE operation, the time in the database is still the time when it was added. What may be the cause?

<code>public function updateInfo($cid,$data){
        $this->db->set($data);
        $this->db->where('cid',$cid);
        if($this->db->update('report')){
            return TRUE;
        } else {
            return FALSE;
        }
    }
</code>
Copy after login
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template