int mysql_affected_rows([mysql link connection]) 

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


Integer; FALSE on error


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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.