Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("koneksi.php");
- $sql = "SELECT * FROM tbl_mahasiswa";
- $result = $conn->query($sql);
- $conn->close();
- ?>
- <html>
- <head>
- <link href="style.css" rel="stylesheet" type="text/css" />
- <title>QuestKomputer - CRUD Mahasiswa</title>
- </head>
- <body>
- <h1>CRUD PHP MySQLi questkomputer.com</h1>
- <div class="button_link"><a href="input.php">Input Data</a></div>
- <table class="tbl-qa">
- <thead>
- <tr>
- <th class="table-header" wnimmhsth="20%">NIM</th>
- <th class="table-header" wnimmhsth="20%">Nama</th>
- <th class="table-header" wnimmhsth="20%"> Alamat </th>
- <th class="table-header" wnimmhsth="20%"> telepon </th>
- <th class="table-header" wnimmhsth="20%"> Jurusan </th>
- <th class="table-header" wnimmhsth="20%" colspan="2">Aksi</th>
- </tr>
- </thead>
- <tbody>
- <?php
- if ($result->num_rows > 0) {
- while($row = $result->fetch_assoc()) {
- ?>
- <tr class="table-row" id="row-<?php echo $row["nimmhs"]; ?>">
- <td class="table-row"><?php echo $row["nimmhs"]; ?></td>
- <td class="table-row"><?php echo $row["namamhs"]; ?></td>
- <td class="table-row"><?php echo $row["alamatmhs"]; ?></td>
- <td class="table-row"><?php echo $row["teleponmhs"]; ?></td>
- <td class="table-row"><?php echo $row["jurusanmhs"]; ?></td>
- <!-- action -->
- <td class="table-row" colspan="2"><a href="edit.php?nimmhs=<?php echo $row["nimmhs"]; ?>" class="link"><img title="Edit" src="icon/edit.png"/></a> <a href="hapus.php?nimmhs=<?php echo $row["nimmhs"]; ?>" class="link"><img name="delete" nimmhs="delete" title="Delete" onclick="return confirm('Yakin akan di Hapus?')" src="icon/delete.png"/></a></td>
- </tr>
- <?php
- }
- }
- ?>
- </tbody>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement