What does the function mysql_affected_rows() return in PHP?

The function mysql_affected_rows() in PHP returns the number of rows affected by the last INSERT, UPDATE, or DELETE query executed. This function can be used to determine the impact of a query on the database.

// Assuming a successful MySQL query has been executed
$affected_rows = mysql_affected_rows($connection);

echo "Number of rows affected: " . $affected_rows;