Non vorrei dire una cavolata, ma quella è una query di SELECT mentre mysql_affected_rows:
Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE query associated with link_identifier.
SELECT Statements:
To retrieve the number of rows returned by a SELECT, it is possible to use mysql_num_rows().