Aqui está funcionando.
<?PHP
$connecta = mysql_connect('127.0.0.1','ragnarok','ragnarok');
$db = mysql_select_db('ragnarok');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="estilo.css" />
<title>Ranking PvP Mooka</title>
</head>
<body>
<div id="ranking">
<table border="0" cellpadding="0" cellspacing="0">
<tr align="center" id="title">
<td>Posição</td>
<td>Nome</td>
<td>Classe</td>
<td>Matou</td>
</tr>
<?PHP
$tabela = mysql_query("SELECT p.`name`, p.`kills`, c.`class` FROM `pvpm_data` p LEFT JOIN `char` c on p.`id` = c.`char_id` ORDER BY p.`kills` DESC LIMIT 50");
$pos = 1;
while($pvp = mysql_fetch_assoc($tabela)){
echo '
<tr align="center" id="player">
<td>'.$pos.'º</td>
<td>'.$pvp['name'].'</td>
<td>'.nome_do_classe($pvp['class']).'</td>
<td>'.$pvp['kills'].'</td>
</tr>
';
$pos++;
}
?>
</table>
</div>
</body>
</html>
<?php
function nome_do_classe($classe) {
switch($classe) {
case 0: return "Novice";
case 1: return "Swordman";
case 2: return "Mage";
case 3: return "Archer";
case 4: return "Acolyte";
case 5: return "Merchant";
case 6: return "Thief";
case 7: return "Knight";
case 8: return "Priest";
case 9: return "Wizard";
case 10: return "Blacksmith";
case 11: return "Hunter";
case 12: return "Assassin";
case 13: return "Knight";
case 14: return "Crusader";
case 15: return "Monk";
case 16: return "Sage";
case 17: return "Rogue";
case 18: return "Alchemist";
case 19: return "Bard";
case 20: return "Dancer";
case 21: return "Crusader";
case 22: return "Wedding";
case 23: return "SuperNovice";
case 24: return "Gunslinger";
case 25: return "Ninja";
case 26: return "Santa_Costume";
case 27: return "Summer_Suit";
case 28: return "Hanbok";
case 4001: return "High_Novice";
case 4002: return "High_Swordman";
case 4003: return "High_Mage";
case 4004: return "High_Archer";
case 4005: return "High_Acolyte";
case 4006: return "High_Merchant";
case 4007: return "High_Thief";
case 4008: return "High_Knight";
case 4009: return "High_Priest";
case 4010: return "High_Wizard";
case 4011: return "Whitesmith";
case 4012: return "Sniper";
case 4013: return "Assassin_Cross";
case 4014: return "Lord_Knight";
case 4015: return "Paladin";
case 4016: return "Champion";
case 4017: return "Professor";
case 4018: return "Stalker";
case 4019: return "Creator";
case 4020: return "Clown";
case 4021: return "Gypsy";
case 4022: return "Paladin";
case 4023: return "Baby_Novice";
case 4024: return "Baby_Swordman";
case 4025: return "Baby_Mage";
case 4026: return "Baby_Archer";
case 4027: return "Baby_Acolyte";
case 4028: return "Baby_Merchant";
case 4029: return "Baby_Thief";
case 4030: return "Baby_Knight";
case 4031: return "Baby_Priest";
case 4032: return "Baby_Wizard";
case 4033: return "Baby_Blacksmith";
case 4034: return "Baby_Hunter";
case 4035: return "Baby_Assassin";
case 4036: return "Baby_Knight";
case 4037: return "Baby_Crusader";
case 4038: return "Baby_Monk";
case 4039: return "Baby_Sage";
case 4040: return "Baby_Rogue";
case 4041: return "Baby_Alchemist";
case 4042: return "Baby_Bard";
case 4043: return "Baby_Dancer";
case 4044: return "Baby_Crusader";
case 4045: return "Super_Baby";
case 4046: return "Taekwon";
case 4047: return "Star_Gladiator";
case 4048: return "Star_Gladiator";
case 4049: return "Soul_Linker";
case 4050: return "Gangsi";
case 4051: return "Death_Knight";
case 4052: return "Dark_collector";
case 4054: return "Rune_Knight";
case 4055: return "Warlock";
case 4056: return "Ranger";
case 4057: return "Arch_Bishop";
case 4058: return "Mechanic";
case 4059: return "Guillotine_Cross";
case 4060: return "Rune_Knight";
case 4061: return "Warlock";
case 4062: return "Ranger";
case 4063: return "Arch_Bishop";
case 4064: return "Mechanic";
case 4065: return "Guillotine_Cross";
case 4066: return "Royal_Guard";
case 4067: return "Sorcerer";
case 4068: return "Minstrell";
case 4069: return "Wanderer";
case 4070: return "Sura";
case 4071: return "Genetic";
case 4072: return "Shadow_Chaser";
case 4073: return "Royal_Guard";
case 4074: return "Sorcerer";
case 4075: return "Minstrel";
case 4076: return "Wanderer";
case 4077: return "Sura";
case 4078: return "Genetic";
case 4079: return "Shadow_Chaser";
case 4080: return "Rune_Knight";
case 4081: return "Rune_Knight";
case 4082: return "Royal_Guard";
case 4083: return "Royal_Guard";
case 4084: return "Ranger";
case 4085: return "Ranger";
case 4086: return "Mechanic";
case 4087: return "Mechanic";
case 4096: return "Baby_Rune";
case 4097: return "Baby_Warlock";
case 4098: return "Baby_Ranger";
case 4099: return "Baby_Bishop";
case 4100: return "Baby_Mechanic";
case 4101: return "Baby_Cross";
case 4102: return "Baby_Guard";
case 4103: return "Baby_Sorcerer";
case 4104: return "Baby_Minstrel";
case 4105: return "Baby_Wanderer";
case 4106: return "Baby_Sura";
case 4107: return "Baby_Genetic";
case 4108: return "Baby_Chaser";
case 4109: return "Baby_Rune";
case 4110: return "Baby_Guard";
case 4111: return "Baby_Ranger";
case 4112: return "Baby_Mechanic";
case 4190: return "Super_Novice_Expanded";
case 4191: return "Super_Baby_Expanded";
case 4211: return "Kagerou";
case 4212: return "Oboro";
// (Adicione as classes restantes)
default: return "Erro";
}
}
?>
Aproveitando o tópico, tanto o script anterior quanto esse novo (funcionando do jeito que eu queria) estão com um "bug".
Eles no ranking aparece tanto jogadores quanto clãs, e o certo deveria ser só jogadores.
Sabe o que pode ser?