[eluser]jayrulez[/eluser]
[quote author="iDVB" date="1251528640"]In my code below I'm setting $description default to NULL but in the MySQL db field it gets inserted as 0 even thought that field defaults to NULL and allows NULL.
Code:
function create($title, $description = NULL, $user_id = false)
{
$response = array();
$user_id = $user_id ? $user_id : $this->_user_id;
$data = array(
'title' => $title,
'description' => $description,
'user_id' => $user_id,
'cdate' => date("Y-m-d H:m:s", time())
);
$this->db->insert('trackGroups', $data);
$response = $this->db->insert_id();
return $response;
}
[/quote]
try this
Code:
function create($title, $description = "", $user_id = false)