-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathttt_record.php
53 lines (49 loc) · 1.47 KB
/
ttt_record.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
<?php
require_once 'header.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Record</title>
</head>
<body>
<header>
<h1><?php echo $_SESSION['player']; ?>'s TITACTOE Record</h1>
</header>
</body>
</html>
<?php
$player=$_SESSION['player'];
$stmt=$conn->prepare("SELECT * FROM titato_record WHERE name='$player'");
$stmt->execute();
$result=$stmt->get_result();
if($result->num_rows > 0){
echo "<div class='scroll'>";
echo "<table>";
echo "<thead>";
echo "<tr>";
echo "<th>recordID</>";
echo "<th>Player</th>";
echo "<th>winner</th>";
echo "<th>date time</th>";
echo "<th>detail</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
while($row=$result->fetch_assoc()){
echo "<tr>";
echo "<td>" . $row['titato_recordID'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['winner'] . "</td>";
echo "<td>" . $row['date_time'] . "</td>";
echo "<td><a href=ttt_matchDetail.php?id=" . $row['titato_recordID'] .">match detail</a></td>";
}
echo "</tbody>";
echo "</table>";
echo "</div>";
}
else{
echo "<p class='result'><em>No records were found.</em></p>";
}
require_once 'footer.php';
?>