Answers for "insert now in codeigniter database"

1

insert now in codeigniter database

$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);
Posted by: Guest on March-12-2021

Code answers related to "insert now in codeigniter database"

Browse Popular Code Answers by Language