Advertisement
ridyko

index.php ( Data Siswa )

Feb 3rd, 2022
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.52 KB | None | 0 0
  1. <?php
  2.  include 'koneksi.php';
  3.  $query = $db->prepare("SELECT * FROM tbl_siswa");
  4.  $query->execute();
  5.  $data = $query->fetchAll();
  6. ?>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <meta charset="utf-8">
  11. <title>CRUD PDO questkomputer.com </title>
  12. </head>
  13. <body bgcolor="#CCCCCC">
  14. <h2><strong><p align="center">Data Siswa questkomputer.com</p></strong></h2>
  15. <table width="807" border="1" cellpadding="0" cellspacing="0" align="center">
  16.  <tr>
  17.  <td width="115" height="30" align="center" valign="middle" bgcolor="#00FFFF">NIS</td>
  18.  <td width="175" align="center" valign="middle" bgcolor="#00FFFF">Nama</td>
  19.  <td width="250" align="center" valign="middle" bgcolor="#00FFFF">Alamat</td>
  20.  <td width="100" align="center" valign="middle" bgcolor="#00FFFF">Kelas</td>
  21.  <td width="135" align="center" valign="middle" bgcolor="#00FFFF"><a href="create.php">TAMBAH</a></td></tr>
  22.  <?php foreach ($data as $value): ?>
  23.  <tr>
  24.  <td p align="center" bgcolor="#FFFFFF"><?php echo $value['nis'] ?></td>
  25.  <td p align="left" bgcolor="#FFFFFF"><?php echo $value['nama'] ?></td>
  26.  <td p align="left" bgcolor="#FFFFFF"><?php echo $value['alamat'] ?></td>
  27.  <td p align="center" bgcolor="#FFFFFF"><?php echo $value['kelas'] ?></td>
  28.  <td p align="center" bgcolor="#FFFFFF">
  29.  <a href="edit.php?nis=<?php echo $value['nis']?>">Edit</a>
  30.  <a href="delete.php?nis=<?php echo $value['nis']?>">Delete</a>
  31.  </td>
  32.  </tr>
  33.  </td>
  34.  </tr>
  35. <?php endforeach; ?>
  36. </table>
  37. <p align="center"><a href=https://www.questkomputer.com/#>www.questkomputer.com</a></p>
  38. </body>
  39. </html>
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement