According to the PHP Manual, you should use any of the following:
- mysqli_stmt_num_rows()
- PDOStatement::rowCount()
To be clear though, neither of these is a mere substitute for mysql_num_rows(). Your code must eventually be rewritten entirely to use the MySQLi or PDO API in lieu of mysql_*().