O'Reilly logo
  • miraj Desai thinks this is interesting:

rowCount() returns the number of affected rows after performing any UPDATE or DELETE query. But you must remember that it returns the number of affected rows by the latest executed query.

$stmt = $pdo->prepare("DELETE from users WHERE name='Anonymous'");
$stmt->execute();
echo $stmt->rowCount();