-
Notifications
You must be signed in to change notification settings - Fork 0
/
table-history.php
50 lines (45 loc) · 956 Bytes
/
table-history.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
<!DOCTYPE html>
<html>
<head>
<title>Registration Result</title>
</head>
<body>
<?php
session_start();
if(isset($_SESSION['userID'])){
$id = $_SESSION['userID'];
}
include('database.php');
$sql = "SELECT * FROM ride_history WHERE ID_no = $id";
$result = $conn->query($sql);
if (!$result) {
die("Invalid query: " . $conn->error);
}
?>
<?php
?>
<table>
<tr>
<th>Serial No.</th>
<th>Reciepient Name</th>
<th>Journey Details</th>
<th>Fare</th>
<!-- Add more columns as needed -->
</tr>
<?php
$serialNo = 1;
while ($row = $result->fetch_assoc()) {
echo "
<tr>
<th>$serialNo</th>
<td>{$row['User_name']}</td>
<td>{$row['start_pos']} TO {$row['end_pos']}</td>
<td>{$row['Fare']}</td>
</tr>
";
$serialNo++;
}
?>
</table>
</body>
</html>