diff --git a/reference/pdo/functions/PDOStatement-rowCount.xml b/reference/pdo/functions/PDOStatement-rowCount.xml index 0bc182799e..8f8e8c21c1 100644 --- a/reference/pdo/functions/PDOStatement-rowCount.xml +++ b/reference/pdo/functions/PDOStatement-rowCount.xml @@ -1,11 +1,11 @@ - + PDOStatement::rowCount - Returns the number of rows in a result set, or the number of rows affected by the last PDOStatement::execute() + Returns the number of rows affected by the last SQL statement @@ -15,12 +15,33 @@ - &warn.undocumented.func; - - - Not always meaningful. - - + &warn.experimental.func; + + PDOStatement::rowCount returns the number of + rows affected by the last DELETE, INSERT, or UPDATE statement + executed by the corresponding PDOStatement object. + + + If the last SQL statement executed by the associated + PDOStatement was a SELECT statement, some databases + may return the number of rows returned by that statement. However, this + behaviour is not guaranteed for all databases and should not be relied + on for portable applications. + + Return the number of deleted rows + +prepare('DELETE FROM fruit'); +$del->execute(); + +/* Return number of rows that were deleted */ +print("Return number of rows that were deleted:\n"); +$count = $del->rowCount(); +print("Deleted $count rows.\n"); +]]> + +