Legende: KD = Kills / Deaths – RaveBattleScore = (XP * KD) / 2
[insert_php]
$servername = “db.ravecraft.de”;
$username = “stats”;
$password = “survey”;
$dbname = “p_whazup”;
$kd_rundung = 2; // KD-Value, Stellen nach dem Komma
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}
$sql = “SELECT player_name, Kills, Deaths, Exp, Kills/Deaths as kd, (Exp*(Kills/Deaths))/2 as rs FROM p_whazup.kb_ where Exp > 0 order by rs desc limit 20”;
$result = $conn->query($sql);
echo “
Avatar | Player | Kills | Deaths | XP | KD | RaveBattleScore |
---|---|---|---|---|---|---|
“; echo ““; echo “ |
“. $row[“player_name”]; echo ” |
“. $row[“Kills”]; echo ” |
“. $row[“Deaths”]; echo “ |
” . $row[“Exp”]; echo ” |
” . round ($row[“kd”],$kd_rundung); echo ” |
” . round ($row[“rs”],0) . “ |
“;
[/insert_php]