mysqli_affected_rows
Get the number of affected rows in a previous MySQL operation
Description
mixedmysqli_affected_rows
resourcelink
mysqli_affected_rows returns the number of rows affected by the last
INSERT, UPDATE, or DELETE query associated with the provided link
parameter. If the last query was invalid, this function will return -1.
When deleting the entire contents of a table (i.e. 'DELETE FROM foo'), this function will
not return the number of rows that were actually deleted.
The mysqli_affected_rows function only works with queries which modify
a table. In order to return the number of rows from a SELECT query, use the
mysqli_num_rows() function instead.
Delete-Query
]]>
The above example would produce the following output:
Update-Query
]]>
The above example would produce the following output: