2025-11-30 22:58:47 -05:00

19 lines
457 B
PHP

<?php
session_start();
$conn = new mysqli("localhost","root","","breakout_db");
$lb = $conn->query("SELECT username, highscore FROM users ORDER BY highscore DESC LIMIT 10");
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>Leaderboard</h2>
<table>
<?php while($r = $lb->fetch_assoc()){ ?>
<tr><td><?= $r['username'] ?></td><td><?= $r['highscore'] ?></td></tr>
<?php } ?>
</table>
</body>
</html>