-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathleaderboard.php
More file actions
48 lines (45 loc) · 1.5 KB
/
leaderboard.php
File metadata and controls
48 lines (45 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/leaderboard.css">
<script src="script.js"></script>
<title>Leaderboard</title>
</head>
<body>
<div class="main-container">
<div class="header">
<h1 class="header-text">Leaderboard</h1>
</div>
<section class="table-view">
<div class="table-content">
<?php
error_reporting(false);
$regID = "";
?>
<div style="overflow-x:auto;">
<table>
<tr>
<th>Position</th>
<th>Username</th>
<th>Points</th>
</tr>
<?php
include 'connect.php';
$sql = "SELECT username, hits from `users` ORDER BY hits desc";
$result = mysqli_query($con,$sql);
$pos = 1;
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<tr><td>" . $pos++ . "</td><td>" . $row["username"] . "</td><td>" . $row["hits"] . "</td></tr>";
}
echo "</table>";
} else { echo "0 results"; }
$con->close();
?>
</section>
</div>
</body>
</html>