I am new in codeigniter.
I am using codeigniter for this project. I have not getting how to update form data in the database. I have inserting,showing data in the dat
Just by having a quick look, I can see you're not passing anything to the $data in your entry_update1 function;
public function entry_update1($id) {
$this->db->where('id', $id);
$this->db->update('user', $data);
}
You're trying to update 'user' with $data, but you haven't set $data.
You have to run update query this way in CodeIgniter.
public function entry_update1($id,$data) {
$this->db->set($data);
$this->db->where('id',$id);
$update = $this->db->update('user');
if($update)
{
return true;
}
else
{
return false;
}
}
You are only passing $id in
$this->usermodel->entry_update1($get['id']);
and in function u did
public function entry_update1($id) {
$this->db->where('id', $id);
$this->db->update('user', $data);
}
so you have to pass $data also in you function call
$this->usermodel->entry_update1($get['id'], $data);
public function entry_update1($id, $data) {
$this->db->where('id', $id);
$this->db->update('user', $data);
}