Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 1);
- ini_set('display_startup_errors', 1);
- error_reporting(E_ALL);
- include('php/classes/sql.php');
- define("DB_HOST", "localhost");
- define("DB_USER", "root");
- define("DB_PASS", "Be03121997");
- define("DB_NAME", "gti");
- $db = new SQL();
- $table = "banking";
- $db->query("SELECT * FROM " . $table . " ORDER BY balance DESC LIMIT 10");
- $bdata = $db->resultset();
- $db->query("SELECT * FROM stats ORDER BY kills DESC LIMIT 10");
- $sdata = $db->resultset();
- ?>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="css/test.css">
- </head>
- <body>
- <table style="width: 25%;">
- <caption>Top 10 Richest Players</caption>
- <tr>
- <th>ID
- <th>Player
- <th>Balance
- </tr>
- <?php
- for ($i = 0; $i < count($bdata); $i++) {
- echo "<tr class='dr'>";
- echo "<td>" . ($i + 1);
- echo "<td>" . $bdata[$i]["name"];
- echo "<td>$" . number_format(($bdata[$i]["balance"] + $bdata[$i]["cash"]));
- echo "</tr>";
- }
- ?>
- </table>
- <table style="width: 30%;">
- <caption>Top 10 Deadliest Players</caption>
- <tr>
- <th>ID
- <th>Player
- <th>Kills
- <th>Deaths
- </tr>
- <?php
- for ($i = 0; $i < count($sdata); $i++) {
- echo "<tr class='dr'>";
- echo "<td>" . ($i + 1);
- echo "<td>" . $sdata[$i]["name"];
- echo "<td>" . number_format($sdata[$i]["kills"]);
- echo "<td>" . number_format($sdata[$i]["deaths"]);
- echo "</tr>";
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment