<a href="?page=&action=tambah "><button>Tambah Data</button></a>
<br />
<br />
<br />
<table border="1px">
<tr>
<th>No</th>
<th>Nama</th>
<th>Username</th>
<th>E-mail</th>
<th colspan="2">Aksi</th>
</tr>
<?php
include "config.php"; // agar bisa connect ke database
$hasil=mysql_query("select * from crud"); // memilih semua data dari tabel user
$no = 1; //membuat no urut
while ($data=mysql_fetch_array($hasil)) { // pengulangan \'while\' agar semua data bisa tampil
?>
<tr align="center">
<td><?php echo $no; ?></td>
<td><?php echo $data[\'nama\'] ?></td>
<td><?php echo $data[\'username\'] ?></td>
<td><?php echo $data[\'email\'] ?></td>
<td height="60px"><a href="?page=&action=edit&id=<?php echo $data[\'id\'] ?>"><button>Edit Data</button></a></td>
<td height="60px"><a href="?page=&action=hapus&id=<?php echo $data[\'id\'] ?>" onclick="return confirm(\'Yakin Hapus !\')"><button>Hapus Data</button></a></td>
</tr>
<?php
$no++; //agar no bisa urut
} // akhir pengulangan while
?>
</table>