-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatchrecalltable.php
54 lines (47 loc) · 1.2 KB
/
matchrecalltable.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
<?php include '/var/www/_database/database.php' ?>
<?php echo '<link rel="stylesheet" type="text/css" href="style.css">';?>
<center><h1 class="rainbowize">Match Recall</h1><center>
<?php
$MatchNum = mysqli_real_escape_string($database, $_POST['MatchNum']);
$result = mysqli_query($database,"SELECT * FROM 2017_game.mytable WHERE matchnum='$MatchNum'");
echo "<table border='1'>";
$i = 0;
while($row = $result->fetch_assoc())
{
if ($i == 0) {
$i++;
echo "<tr>";
foreach ($row as $key => $value) {
echo "<th>" . $key . "</th>";
}
echo "</tr>";
}
echo "<tr>";
foreach ($row as $value) {
echo "<td>" . $value . "</td>";
}
echo "</tr>";
}
echo "</table>";
$result = mysqli_query($database,"SELECT count(*) FROM 2017_game.mytable WHERE matchnum = '$MatchNum'");
echo "<table border='1'>";
$i = 0;
while($row = $result->fetch_assoc())
{
if ($i == 0) {
$i++;
echo "<tr>";
foreach ($row as $key => $value) {
echo "<th>" . $key . "</th>";
}
echo "</tr>";
}
echo "<tr>";
foreach ($row as $value) {
echo "<td>" . $value . "</td>";
}
echo "</tr>";
}
echo "</table>";
mysqli_close($database);
?>