Welcome Guest, Not a member yet? Register   Sign In
update() method in model inserts data
#1

[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);

#2

[eluser]marcogmonteiro[/eluser]
You need to be a bit more specific about your problem.
#3

[eluser]Unknown[/eluser]
No No. I got it... this thread can be closed.




Theme © iAndrew 2016 - Forum software by © MyBB