How do I insert values in a database field with type timestamp? I am doing this way in CodeIgniter.
$user_poll_query=array('description'=>$poll_query,
'creator_id'=>$user_id,
'valid_from'=>date('Y-m-d H:i:s','1299762201428'),
);
$this->db->insert('sl_polls',$user_poll_query);
but in the database I am getting 0s (0000-00-00 00.00.00).
Well it looks like you are using
but your date isn’t in the format Y-m-d H:i:s.
Try a different date format or convert the UNIX timestamp to a date your db can use.
Hope that helps!