rowCount() returns the number of affected rows after performing any
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();
Share this highlighthttp://www.safaribooksonline.com/a/object-oriented-programming-with/3472/