Teknotes.id – Seorang programmer harus bisa basic dasar dari CRUD, karena CRUD sendiri berguna untuk membuat sebuah aplikasi, entah itu aplikasi berbasis website maupun mobile atau desktop.
Bagi kamu seorang programmer wajib banget harus bisa membuat CRUD. Berikut ini artikel tentang Tutorial Membuat CRUD PHP 5 Dengan MySQL #PartRead
Daftar Isi
1. Read
Copy paste script code dibawah ini kemudian simpan dengan nama read.php
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" > <meta name="viewport" content="width=device-width, initial-scale=1.0" > <title>Tutorial Membuat CRUD by etgarnotes.com | Read </title> <!---================Assets=====================--> <link href="assets/css/bootstrap.css" rel="stylesheet"> <link href="assets/css/font-awesome.css" rel="stylesheet"> <!---================End Assets=====================--> </head> <body> <center><h2>Data Siswa Siswi Kelas X Tunas Bangsa</h2><center> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"><h6 class="panel-title" align="center"><;i class="fa fa-users"></i> Data Siswa Siswi Kelas X</h6> <a href="create.php"><input type="submit" value="Tambah" class="btn btn-info"></a></div> <div class="panel-body"> <div class="table-responsive"> <table class="table table-striped table-bordered table-hover"> <thead> <tr> <th>No</th> <th>NIS</th> <th>Nama</th> <th>Kelas</th> <th>Alamat</th> <th>Jenis Kelamin</th> <th>Agama</th> <th>Jurusan</th> <th>Aksi</th> </tr> </thead> <tbody> <?php include "config/koneksi.php"; $nomor = 0; $result = mysql_query("SELECT * FROM siswa") or die (mysql_error()); while ($data = mysql_fetch_array($result)) { ?> <tr> <td><?php echo $nomor=$nomor+1; ?></td> <td><?php echo $data['nis']; ?></td> <td><?php echo $data['nama']; ?><;/td> <td><?php echo $data['kelas']; ?><;/td> <td><?php echo $data['alamat']; ?></td> <td><?php echo $data['jk']; ?></td> <td><?php echo $data['agama']; ?></td> <td><?php echo $data['jurusan']; ?></td> <td> <a href="update.php?nis=?php echo $data['nis']; " title="Update"><i class='fa fa-edit' title="Update"></i></a> <a onclick="return confirm('Anda Yakin Akan Menghapus Data?');" href="delete.php?nis=?php echo $data['nis'];>;"><i class='fa fa-trash' title="Delete"></i></a> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> </body> </html>
2. Tampilan
Kesimpulan
Read bisa diartikan membaca atau menampilkan data pada aplikasi CRUD. Demikian artikel tentang Tutorial Membuat CRUD PHP 5 Dengan MySQL #PartRead jika ada saran silahkan komentar, semoga bermanfaat. Terima kasih
Semua Tutorial
Tutorial Membuat CRUD PHP 5 Dengan MySQL #PartCreateTutorial Membuat CRUD PHP 5 Dengan MySQL #PartRead
Tutorial Membuat CRUD PHP 5 Dengan MySQL #PartUpdate
Tutorial Membuat CRUD PHP 5 Dengan MySQL #PartDelete