[eluser]Unknown[/eluser]
My password update function works fine but I noticed it fails when I try to update the password using my current password. This is the function inside the model:
Code:
function change_password($username) {
$update_data = array(
'password' => md5($this->input->post('new_password'))
);
$this->db->update('users', $update_data, "username = '$username'");
if ($this->db->affected_rows() == 1) {
return true;
} else {
return false;
}
}
Any suggestions?