I have an issue.
public function ChangePassword($username, $password, $new_password) {
$canUserLogin = $this->isLoginExist($username, $password);
if($canUserLogin){
$query = "UPDATE users SET password = $new_password WHERE username = $username";
$inserted = mysqli_query($this->db->getDb(), $query);
if($inserted == 1){
$json['success'] = 1;
}else{
$json['success'] = 0;
}
mysqli_close($this->db->getDb());
}else{
$json['success'] = 2;
}
return $json;
}
I have an Android application with login and register system. I just created changePassword activity. So, when I type in the fields and press button it says that the password was changed. But when I go to database, the older password is still there. What is wrong? Thank you.