1 2016 Create Read Update Delete using PHP MySql CRUD TABEL ALUMNI DWI SETIYA NINGSIH // [COMPANY NAME] [Company address]2 SS Program Gambar 1.1 Tampi...
Gambar 2.1 Tampilan edit.php berupa form pengeditan data
Gambar 2.2 Tampilan index.php setelah data berhasil di edit
Gambar 3.1 Tampilan input.php berupa form entry data baru, ketika “Input Data” di klik
Gambar 3.2 Tampilan index.php setelah data baru berhasil ditambahkan
Gambar 4.1 Tampilan delete.php kotak dialog konfirmasi atas penghapusan data terpilih
Gambar 3.1 Tampilan index.php setelah data berhasil dihapus
Source Code Koneksi.php
$dbnm = "school"; $conn = mysql_connect ($host, $user, $pass); if ($conn) { $buka = mysql_select_db ($dbnm); if (!$buka) { die ("Database tidak dapat dibuka"); } } else { die ("Server MySQL tidak terhubung"); } ?>
Index.php Data Alumni
CRUD Data Alumni
: include "edit.php"; break;
case 'delete' : include "delete.php"; break; case 'main' : default : include 'tampil.php'; } ?>
if (strlen ($nim) != 5) { echo"<script>alert('NIM harus 5 digit !',document.location.href='index.php?page=input')"; } $query = "INSERT INTO alumni VALUES('$nim','$nama','$prodi','$lulus','$kerja')"; $sql = mysql_query ($query) or die (mysql_error()); if ($sql) { echo"<script>alert('Data Alumni telah berhasil ditambahkan !',document.location.href='index.php')"; } else { echo"<script>alert('Data Alumni gagal ditambahkan !',document.location.href='index.php')"; } } ?>