$result = dbquery("SELECT tt.page_id FROM ".DB_CUSTOM_PAGES." tt INNER JOIN ".DB_RATINGS." tf ON tt.page_id=tf.rating_item_id WHERE rating_type='C' ORDER BY rating_vote DESC LIMIT 0,10");
$nr=0;
$game = $data['page_title'];
$gid = $data['page_id'];
while ($data = dbarray($result)) {
$nr++;
echo "#{$nr} - <a href='game.php?id=$gid'>$game</a><br>";
}
<a href='game.php?id=$gid'>$game</a>