Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Achmad Faturohman</title>
- </head>
- <body>
- <h2 align="center">Menampilkan Database Dengan PHP</h2>
- <table border="1" align="center">
- <tr align="center">
- <th>Kode Buku</th>
- <th>Judul Buku</th>
- <th>Pengarang</th>
- <th>Penerbit</th>
- <th>Harga</th>
- <th>Tahun Terbit</th>
- </tr>
- <?php
- include 'koneksi.php';
- $kode_buku=1100011;
- $buku = mysqli_query($connection,"select * from buku");
- while ($data = mysqli_fetch_array($buku))
- {
- ?>
- <tr align="center">
- <td><?php echo $kode_buku; ?></td>
- <td align="left"><?php echo $data['judul_buku']; ?></td>
- <td><?php echo $data['pengarang']; ?></td>
- <td><?php echo $data['penerbit']; ?></td>
- <td><?php echo $data['harga']; ?></td>
- <td><?php echo $data['tahun_terbit']; ?></td>
- </tr>
- <?php
- $kode_buku++;
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement