I think this cannot be done normally, but you can use a different column for reference.
Add the counter column to the users table. And then just increase this value with every update.
$stmt = $conn->prepare('UPDATE users SET name = :name, counter = counter + 1 WHERE id = :id'); $result = $stmt->rowCount(); // 1 if ($result == 1) {echo "success!";}
So now, it doesnโt matter if the name value changes or not, counter will change every time, so it will return 1 every time if it succeeds.
Or, as Damodaran replied, instead of counter you can use the current datetime when updating.
source share