Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "koneksi.php"; //memanggil file koneksi.php
- ?>
- <h3>::DATA MAHASISWA::</h3>
- <a href="insert.php">[+]Tambah</a> <!---link untuk menambahkan data--->
- <table border="2">
- <tr><th>No</th><th>NPM</th><th>NAMA</th><th>ALAMAT</th><th>AKSI</th></tr>
- <?php
- $query=mysql_query("select * from mahasiswa"); //Query database untuk menampilan data
- $no=1; //Variable untuk membuat nomor urut secara otomatis
- while($tampil = mysql_fetch_array($query)) //Perulangan While untuk menampilan data
- {
- ?>
- <tr>
- <td><?php echo $no++; //nomor urut otomaris ?></td>
- <td><?php echo $tampil['npm']; //menampikan field npm ?></td>
- <td><?php echo $tampil['nama']; //menampikan field nama ?></td>
- <td><?php echo $tampil['alamat']; //menampikan field alamat ?></td>
- <td><a href="edit.php?npm=<?php echo $tampil['npm'];?>">EDIT</a> || <!---link untuk edit data--->
- <a href="hapus.php?npm=<?php echo $tampil['npm'];?>">HAPUS</a></td> <!---link untuk hapus data--->
- </tr>
- <?php
- }
- ?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement