int mysql_num_rows ( resource $result )
Retrieves the number of rows
from a result set. This command is only valid for statements like
SELECT or SHOW that return an actual result set. To retrieve the
number of rows affected by a INSERT, UPDATE, REPLACE or DELETE query,
And here's mysql_affected_rows:
int mysql_affected_rows ([ resource $link_identifier = NULL ] )
Get the number of affected rows by the last INSERT, UPDATE, REPLACE or
DELETE query associated with link_identifier.
Notice that the input types are different: the first wants a result set, from which it counts the number of rows returned; the second wants a db handle. That makes sense, though, because when you
REPLACE) a row, you typically don't want a result set -- you just want to know if it succeeded or failed, or how many rows it updated/replaced/deleted.