[eluser]Mohammed Zayan[/eluser]
I use this code in my model
Code:
function addBook($photo_link){
$data = array(
'id' => NULL,
'book_cat_id' => $this->input->post('cat'),
'book_name' => $this->input->post('name')
);
$q = $this->db->insert('book', $data);
if($q){
$id = $this->db->insert_id('book');
$data = array(
'id' => NULL,
'book_id' => $id,
'book_cat_id' => $this->input->post('cat'),
'language_id' => 1,
'name' => $this->input->post('name'),
'auther' => $this->input->post('auther'),
'photo_link' => $photo_link,
'dwonload_link' => $this->input->post('dwonload_link'),
'view_link' => $this->input->post('view_link'),
'about' => $this->input->post('about'),
'creation_date' => date('d-m-Y')
);
$query = $this->db->insert('book_translation', $data);
if($query){
return TRUE;
}
}
}
but creation_date field like this 0000-00-00
Is the way I use wrong?