-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuku.php
More file actions
33 lines (28 loc) · 962 Bytes
/
Copy pathbuku.php
File metadata and controls
33 lines (28 loc) · 962 Bytes
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
<?php
// Create database connection using config file
include_once("config.php");
// Fetch all users data from database
$result_buku = mysqli_query($mysqli, "SELECT * FROM buku ORDER BY id_buku DESC");
?>
<html>
<head>
<title>Homepage</title>
</head>
<body>
<a href="add_buku.php">Add New book</a><br/><br/>
<table width='80%' border=1>
<tr>
<th>judul_buku</th> <th>tahun_terbit</th> <th>penulis</th> <th>Update</th>
</tr>
<?php
while($user_data_buku = mysqli_fetch_array($result_buku)) {
echo "<tr>";
echo "<td>".$user_data_buku['judul_buku']."</td>";
echo "<td>".$user_data_buku['tahun_terbit']."</td>";
echo "<td>".$user_data_buku['penulis']."</td>";
echo "<td><a href='edit_buku.php?id_buku=$user_data_buku[id_buku]'>Edit</a> | <a href='delete_buku.php?id_buku=$user_data_buku[id_buku]'>Delete</a></td></tr>";
}
?>
</table>
</body>
</html>