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

ON UPDATE CURRENT_TIMESTAMP is invalid

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-04 09:21:26
Original
3862 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:
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template