-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.php
43 lines (35 loc) · 983 Bytes
/
index.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
<?php
// INCLUDE KONEKSI KE DATABASE
include_once("config.php");
// AMBIL DATA DARI DATABASE BERDASARKAN DATA TERAKHIR DI INPUT
$result = mysqli_query($mysqli, "SELECT * FROM users ORDER BY id DESC");
?>
<html>
<head>
<title>Homepage</title>
</head>
<body>
<center>
<a href="add.html">Tambah Data Baru</a><br /><br />
<table width='80%' border=0>
<tr bgcolor='#CCCCCC'>
<td>Nama</td>
<td>Umur</td>
<td>Email</td>
<td>Gambar</td>
<td>Update</td>
</tr>
<?php
while ($res = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $res['nama'] . "</td>";
echo "<td>" . $res['umur'] . "</td>";
echo "<td>" . $res['email'] . "</td>";
echo "<td><img width='80' src='image/" . $res['gambar'] . "'</td>";
echo "<td><a href=\"edit.php?id=$res[id]\">Edit</a> | <a href=\"delete.php?id=$res[id]\" onClick=\"return confirm('Kamu yakin untuk delete ini?')\">Delete</a></td>";
}
?>
</table>
</center>
</body>
</html>