How To Insert Time In Table Using Codeigniter

[Solved] How To Insert Time In Table Using Codeigniter | Php - Code Explorer | yomemimo.com
Question : insert current time using CodeIgniter

Answered by : manoj-kumar

$data = array( 'user_id' => $user_id, 'otp' => $otp
);
$this->db->set('create_at', 'NOW()', FALSE);
$this->db->insert('otp_expiry', $data);
//or 1 day expire
$this->db->set('create_at', 'NOW() + INTERVAL 1 DAY', FALSE);
$this->db->insert('otp_expiry', $data);

Source : | Last Update : Fri, 19 Mar 21

Answers related to how to insert time in table using codeigniter

Code Explorer Popular Question For Php