RaveBattle Statistiken

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 “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;

if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {

echo “

“;
}
} else {
echo “0 results”;
}

$conn->close();
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]