mysql_num_rows should use mysql_query, not SQL query