-
-
//Data update - $sql = "UPDATE `test` SET `name`=:name WHERE `id`=:id";
- $stmt = $pdo ->prepare($sql);
- $stmt->execute(array(':name' => 'Liu Ba', ':id' => 8));
- < p>echo $stmt->rowCount();
-
Copy code
Also:
PDOStatement::rowCount() Returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement executed by the corresponding PDOStatement object.
|