I am having following MySQL table
EventId ObjectKey Title Description When Duration Where Status
INT CHAR(36) VARCHAR(500) VARCHAR(8000) DATETIME VARCHAR(500) VARCHAR(500) TINYINT
and my PHP array is
$data = array(
'Title' => $title,
'Description' => $description,
'When' => $when,
'Duration' => $duration,
'Where' => $where
);
The variable $when contains 02/21/2013. When I try to insert to the table with CodeIgniter
public function insert_event($guid, $data)
{
$CI = & get_instance();
$CI->load->database('default');
$CI->db->set($data);
$CI->db->set('ObjectKey', $guid);
$CI->db->set('Status', 1);
$vari = $CI->db->insert('Events');
return $vari;
}
Everything inserted correctly except date. Can you help me on this?