CodeIgniter Forums
Model is not producing MySQL error #1292 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forum-6.html)
+--- Forum: Issues (https://forum.codeigniter.com/forum-19.html)
+--- Thread: Model is not producing MySQL error #1292 (/thread-79082.html)



Model is not producing MySQL error #1292 - ipmeel - 04-17-2021

Code:
$this->set('verification_code', NULL)
    ->set('email_verified_at', "Any-string")
    ->where([
        'email'=> $email,
        'email_verified_at' => NULL,
        'verification_code' => $verification_code,
    ])->update();
CI4, CI_ENVIRONMENT = development
The Model is inserting "0000-00-00 00:00:00" in column `email_verified_at`. Why CI4 not producing a MySQL error #1292 - Incorrect datetime value?


RE: Model is not producing MySQL error #1292 - InsiteFX - 04-17-2021

Because that is the MySQL default datetime value.