mysql_affected_rows

int mysql_affected_rows([mysql link connection]) 

Reports the number of rows modified by the last MySQL query.

Returns:

Integer; FALSE on error

Description:

mysql_affected_rows() returns a count of the number of rows that were modified by the last MySQL query made using the specified connection . If the connection argument is not set, the last connection opened will be used. If the specified query failed, mysql_affected_rows() returns -1. If an error occurs, FALSE is returned.

mysql_affected_rows() returns the number of rows modified by a query. This means that only queries that actually change a table (such as most DELETE, INSERT, REPLACE, and UPDATE queries) will cause this function to generate a value other than 0. In ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.