[eluser]Unknown[/eluser]
Model's update() method updates the existing data and inserts a new data. Please help.
Code:
$this->load->database();
$data = array(
'title'=>$this->input->post('title'),
'author'=>$this->input->post('author'),
'publisher'=>$this->input->post('publisher'),
'year'=>$this->input->post('year'),
'available'=>($this->input->post('available')=='0')?"no":"yes",
'summary'=>$this->input->post('summary'),
'modi_date'=>time()
);
$this->db->where('id',$this->input->post('id'));
$this->db->update('books',$data);