php pdo update get affected rows code example
Example: get the number of affected rows in php using pdo update statement
<?php
$update_stmt = $db->prepare("UPDATE user SET name=:name WHERE id=:id");
$updatedCount = $update_stmt->execute(['name' => 'Bernard Arhia','id' => 2]);
//$updateCount will return true if query was successful else it will return false