MySQL with PHP, trying to update a row:
$dbQuery = 'UPDATE UserTable SET Age=25 WHERE Id=3';
$result = mysqli_query($dbLink, $dbQuery);
if ($result === FALSE) {
// Take care of error
}
else {
$numAffectedRows = mysqli_affected_rows($dbLink);
}
I get zero $numAffectedRows in two different cases:
1. When there is no user row with Id=3
2. When there is a user row with Id=3 but Age was already 25 before
Is there a way I can distinguish between the two cases? (apart from reading the row before and manually check the value before updating)