Here is my case:
$sql = 'UPDATE user SET password = ? WHERE username = ? AND password = ?'; if($stmt->prepare($sql)) { $stmt->bind_param('sss', $newPass, $_SESSION['username'], $oldPass); $stmt->execute(); }
Now, how can I check if the UPDATE query succeeds? And more precisely, how can I check if the old password and username are correct so that I can save the new password? I tried to do this:
$res = $stmt->execute(); echo 'Result: '.$res;
But I always get:
Result: 1
even if the old password is incorrect.
Dim13i
source share