-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplayticket.php
More file actions
58 lines (50 loc) · 1.2 KB
/
Copy pathdisplayticket.php
File metadata and controls
58 lines (50 loc) · 1.2 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
48
49
50
51
52
53
54
55
56
57
58
<html>
<head>
<link rel="stylesheet" href="./table.css">
<style>
body{
background-image: url("./train12.jpg");
height: 100%;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
table{
width: 50%;
margin-left: auto;
margin-right: auto;
}
</style>
</head>
<body bgcolor="black">
<?php
include "db.php";
$sql = "SELECT * FROM buy";
$result = $conn->query($sql);
?>
<table>
<tr>
<th>platformno</th>
<th>name</th>
<th>quantity</th>
</tr>
<?php
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo '<tr>';
echo '<td>' . $row['platformno'] . '</td>';
echo '<td>' . $row['name'] . '</td>';
echo '<td>' . $row['quantity'] . '</td>';
// echo "<br> trainname: ". $row["trainname"]. " -trainno: ". $row["trainno"]. " -source: " . $row["source"] . " -destination: " . $row["destination"] . " -arrivaltime: " . $row["arrivaltime"] . " -departuretime :" . $row["departuretime"] . "<br>";
echo '</tr>';
}
} else {
echo "0 results";
}
$conn->close();
?>
</table>
</body>
</html>