-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtripdescending.php
More file actions
50 lines (46 loc) · 1.08 KB
/
Copy pathtripdescending.php
File metadata and controls
50 lines (46 loc) · 1.08 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bus Trips</title>
</head>
<body>
<?php
include 'connectdb.php';
?>
<h1>Here are the bus trips:</h1>
<table border ="2"> <!-- add table with header cells -->
<tr>
<th>Trip ID</th>
<th>Start Date</th>
<th>End Date</th>
<th>Country Visiting</th>
<th>Trip Name</th>
<th>License Plate ID</th>
<th>Image</th>
</tr>
<ol>
<?php
$query = 'SELECT * FROM bustrip ORDER BY tripName DESC;';
$result=mysqli_query($connection,$query);
if (!$result) {
die("database query2 failed.");
}
while ($row=mysqli_fetch_assoc($result)) {
echo "<tr>";
echo "<td>" . $row['busTripID'] ."</td>";
echo "<td>" . $row['startDate'] ."</td>";
echo "<td>" . $row['endDate'] ."</td>";
echo "<td>" . $row['countryToVisit'] ."</td>";
echo "<td>" . $row['tripName'] ."</td>";
echo "<td>" . $row['licensePlateID'] ."</td>";
echo "<td>" . $row['image'] ."</td>";
}
mysqli_free_result($result);
?>
</ol>
<?php
mysqli_close($connection);
?>
</body>
</html>