[eluser]hogava[/eluser]
hi.
this is my controller:
Code:
function edit()
{
$this->load->view('edit_book_form');
echo $id = $this->uri->segment(3);
}
function update()
{
$data = array(
'title' => $this->input->post('title'),
'author' => $this->input->post('author'),
'publisher' => $this->input->post('publisher'),
'pagesnumber' => $this->input->post('pagesnumber')
);
$this->book_model->edit_book($data);
$this->success();
}
and this is Model:
function edit_book($data) {
$this->db->from('book');
$this->db->where('id', 4);
$this->db->update('book', $data);
}
i want replace Number 4 in WHERE command with $id of edit function.
please help me