-
Notifications
You must be signed in to change notification settings - Fork 0
/
list2.php
47 lines (38 loc) · 930 Bytes
/
list2.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
<!DOCTYPE html>
<html>
<head>
<title>Basic CRUD</title>
</head>
<body>
<?php
require 'config.php'; // include file connect to db
include 'menu.php'; //include menu list from menu.php, you may edit accordingly
$sql = "SELECT * FROM pelanggan, kereta WHERE pelanggan.idPelanggan = kereta.idPelanggan";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
echo "<table border='1'>
<tr>
<th>ID</th>
<th>Name</th>
<th>Bapa</th>
<th>Kereta</th>
<th>Plat</th>
</tr>";
while($row = $result->fetch_array()) {
echo "<tr>
<td> ". $row["idPelanggan"]. " </td>
<td> ". $row["namaSendiri"]. " </td>
<td>" . $row["namaBapa"] . "</td>
<td>" . $row["kereta"] . "</td>
<td>" . $row["plat"] . "</td>
</tr>";
}
} else {
echo "0 results";
}
$conn->close();
include 'footer.php';
?>
</body>
</html>