Advertisement
pinguin09

Untitled

Jun 25th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.29 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7.     <title>Achmad Faturohman</title>
  8. </head>
  9. <body>
  10.     <h2 align="center">Menampilkan Database Dengan PHP</h2>
  11.     <table border="1" align="center">
  12.         <tr align="center">
  13.             <th>Kode Buku</th>
  14.             <th>Judul Buku</th>
  15.             <th>Pengarang</th>
  16.             <th>Penerbit</th>
  17.             <th>Harga</th>
  18.             <th>Tahun Terbit</th>
  19.         </tr>
  20.         <?php
  21.         include 'koneksi.php';
  22.         $kode_buku=1100011;
  23.         $buku = mysqli_query($connection,"select * from buku");
  24.         while ($data = mysqli_fetch_array($buku))
  25.         {
  26.         ?>
  27.             <tr align="center">
  28.                 <td><?php echo $kode_buku; ?></td>
  29.                 <td align="left"><?php echo $data['judul_buku']; ?></td>
  30.                 <td><?php echo $data['pengarang']; ?></td>
  31.                 <td><?php echo $data['penerbit']; ?></td>
  32.                 <td><?php echo $data['harga']; ?></td>
  33.                 <td><?php echo $data['tahun_terbit']; ?></td>
  34.             </tr>
  35.         <?php
  36.         $kode_buku++;
  37.         }
  38.         ?>
  39.     </table>    
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement