-
Notifications
You must be signed in to change notification settings - Fork 0
/
berita.php
47 lines (40 loc) · 1.22 KB
/
berita.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 lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-compatible" content="IE-edge">
<meta name="viewport" contant="width=devide-width, initial-scale=1.0">
<title>Data Berita</title>
</head>
<body>
<h1 style="text-align: center;">Data Berita</h1>
<a href="/crud-php/index.php">HOME</a><br>
<a href= "./berita/tambah_berita.php">Tambah Berita</a>
<table border="1px" width="80%">
<tr>
<td>id_berita</td>
<td>tanggal</td>
<td>uraian_berita</td>
<td>sumber</td>
<td>opsi</td>
</tr>
<td>
<?php
include "koneksi.php";
$query =mysqli_query($koneksi, "SELECT *FROM berita ORDER BY id_berita");
while ($row = mysqli_fetch_array($query)) {
?>
<tr>
<td><?= $row['id_berita']; ?></td>
<td><?= $row['tanggal']; ?></td>
<td><?= $row['uraian_berita']; ?></td>
<td><?= $row['sumber']; ?></td>
<td>
<a href="./berita/edit.php?id_berita=<?= $row ['id_berita'];?>">edit</a>
<a href="./berita/delete.php?id_berita=<?= $row ['id_berita'];?>" onclick ="return confirm ('Apakah anda yakin mau hapus ?')">delete</a>
</td>
<?php }?>
</td>
</table>
</body>
</html>