Welcome Guest, Not a member yet? Register   Sign In
Bulk insert query with datetime field
#1

HI,

I'm still struggle to insert bulk insert data with datetime column to database.

Currently i'm using, if any datetime column in database means,   the below codes i use

        $pub_contact_info = array(
           'cc_contact_id'        => $pub_contact_id,
        );
        $this->db->set('cc_created_date', 'NOW()', FALSE);
        $this->db -> insert('ch_contact', $pub_contact_info);

But, in batch insert means, how can i use NOW() in insert_batch() function

Thanks in advance.
Reply
#2

Try:
Code:
$right_now = date("Y-m-d H:i:s");
$this->db->set('cc_created_date', $right_now, FALSE);

Maybe not tested
Practical guide to IgnitedCMS - Book coming soon
Reply




Theme © iAndrew 2016 - Forum software by © MyBB