Praktikum 4

Pembuatan Tabel “tb_mhs”
















Deskripsi tabel “tb_mhs” setelah dibuat











Memasukkan satu data pada “tb_mhs”














koneksi.php













home.php









input.php

























add_process.php

edit.php

edit_process.php


show.php

<?php


include "koneksi.php";


$query="select * from tb_mhs";


$data=mysql_query($query);
?>

<html>
<head><title>Lihat Data</title></head>
<body bgcolor="#777700">
<hr width="50%" color="blue">
<h3><p align="center">DATA NAMA PRAKTIKUM</p></h3>
<hr width="50%" color="blue">
<table align="center" border="1" cellspacing="0" cellpadding="5">
<th>NBI</th>
<th>NAMA</th>
<th>KELAS</th>
<th>ALAMAT</th>
<th>AKSI</th>
<?php
while($datanya=mysql_fetch_array($data))
{
?>
<tr>
<td><?php echo $datanya[0];?></td>
<td><?php echo $datanya[1];?></td>
<td><?php echo $datanya[2];?></td>
<td><?php echo $datanya[3];?></td>
<td>
<a href="delete.php?id=<?php echo $datanya[0];?>">HAPUS</a>&nbsp/&nbsp
<a href="edit.php?id=<?php echo $datanya[0];?>">EDIT</a>
</td>
</tr>
<?php
}
?>
</table>
<p align="center">
<a href="input.php">TAMBAH DATA</a>
<a href="home.php">KEMBALI</a>
</p>
<hr width="50%" color="blue">
</body>
</html>


delete.php

<?php

include "koneksi.php";
$data=$_GET['id'];
mysql_query("delete from tb_mhs where NBI='$data'");
header("location:show.php");
?>




Halaman Awal









Lihat Data Mahasiswa










Input Data Mahasiswa











Data Tersimpan di Database







Edit Data Mahasiswa











Data Tersimpan Setelah Diedit
Sebelum diedit







Setelah diedit


















Data Dengan Nama Edo Katon Setiyawan diihapus
Sebelum dihapus



















Setelah dihapus





Tidak ada komentar: