Im sorry im new in CI4,
I want to update my database with a form. But it can not update where i want to, even i put code where in it, if i delete the where code, they will update all of my record in my database, please ive been reading the documentation of CI4 and i still cant understand why my code can not detect the where code.
here's my code to update it
//update data name / bio
$name = $this->input->post('name');
$email = $this->input->post('email');
$bio = $this->input->post('bio');
$data = [
'name' => $name,
'bio' => $bio
];
$this->db->set($data);
$this->db->where('email', $email);
$this->db->update('user');
Aucun commentaire:
Enregistrer un commentaire