Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Password update issue
#1

[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?




Theme © iAndrew 2016 - Forum software by © MyBB