Skrip tampilhapus.php:
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<table width="438" border="1">
<tr
>
<td
colspan="4" bgcolor="#99CC66"><div align="center"><strong>TAMPIL DATA ANGGOTA </strong></div></td>
</tr
>
<tr
>
<td width="51"
bgcolor="#99FFCC">
<div align="center"><strong>ID</strong></div></td>
<td width="123"
bgcolor="#99FFCC">
<div align="center"><strong>Nama</strong></div></td>
<td width="162"
bgcolor="#99FFCC">
<div align="center"><strong>Alamat</strong></div></td>
<td width="74"
bgcolor="#99FFCC">
<div align="center"><strong>Tombol</strong></div></td>
</tr
>
<?php
$koneksi=mysql_connect("localhost","root","password
")
or die("Koneksi Gagal".mysql_error());
if($koneksi){ mysql_select_db("buku",$koneksi)or die ("Database gagal dibuka ".mysql_error());
//Mejalankan
Query
$sql=mysql_query("SELECT * FROM anggota",$koneksi) or die("Query Gagal".mysql_error()); while($data=mysql_fetch_array($sql)){
?>
<tr>
<td><?php echo $data['id_anggota'];?></td>
<td><?php echo $data['nm_anggota'];?></td>
<td><?php echo $data['alamat'];?></td>
<td align="center">
<a href="hapusdata.php?ID=<?php
echo $data['id_anggota'];?>">Hapus</a></td>
</tr>
<?php }} ?>
</table>
</body>
</html>
No comments:
Post a Comment