Other people asked this question, but mine is a bit more specific.
I have this query:
$sql = "UPDATE table SET option=? WHERE number=?"; $q = $conn->prepare($sql); $q->execute(array($option, $number)); $q->setFetchMode(PDO::FETCH_BOTH); echo $q->rowCount();
If a WHERE number already exists and the SET option the same, $q->rowCount() is 0
If the WHERE number does not exist and the row is not updated, $q->rowCount() is 0
How can I distinguish between these non-updates?
source share