-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrank.php
69 lines (62 loc) · 1.77 KB
/
rank.php
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
header("application/json; charset=utf-8");
session_name("mysession");
session_start();
require_once("dbconnect.php");
if(!isset($_SESSION['login'])){
header("Location: index.php");
}
$idplayer=(int)$_SESSION['userid'];
$query="SELECT login,games,points FROM gracze ORDER BY points DESC";
/*$result=mysqli_query($connection,$query);
$resultString = mysqli_fetch_assoc($result);*/
$result = $connection->query($query);
/*if ($result->num_rows <= 0) {
// output data of each row
echo "Brak wyników";
}*/
?>
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>Rejestracja</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<style>
h1{
text-align: center;
}
</style>
</head>
<body>
<h1>Lista Twoich Wyników</h1>
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Nazwa gracza</th>
<th scope="col">Liczba rozegranych gier</th>
<th scope="col">Punkty</th>
</tr>
</thead>
<tbody>
<?php $id=1; while($row = $result->fetch_assoc()) {?>
<tr>
<th scope="row"><?php echo $id++; ?></th>
<td><?php echo $row["login"] ?></td>
<td><?php echo $row["games"] ?></td>
<td><?php echo $row["points"] ?></td>
</tr>
<?php }?>
</tbody>
</table>
<a href="http://localhost/milionerzy"><div class="form-row justify-content-center">
Strona główna
</div></a>
<?php
$connection->close();
?>
</body>
</html>