Demo entry 6648040

tampil.php

   

Submitted by anonymous on Oct 22, 2017 at 16:46
Language: PHP. Code size: 1.4 kB.

<!-- <?php 

	// include_once('koneksi.php');

	// $hasil = mysqli_query($koneksi,"SELECT * FROM data_user WHERE login_id=".$_SESSION['id']."ORDER BY id DESC");

 ?> -->

 <!DOCTYPE html>
 <!DOCTYPE html>
 <html>
	 <head>
	 	<title>Data Pengguna</title>
	 </head>
	 <body>
	 <a href="tambah.html">Tambah Data</a>
	 	<table cellpadding="5" border="1" align="center" style="margin-top: 20px;">
	 		<tr>
	 			<th>No</th>
	 			<th>Nama</th>
	 			<th>Jenis Kelamin</th>
	 			<th>Tanggal Lahir</th>
	 			<th>User Id</th>
	 			<th>Edit</th>
	 		</tr>

	 		<?php 
	 			include_once('koneksi.php');

	 			$result = mysqli_query($koneksi, "SELECT data_user.*, user.id FROM data_user INNER JOIN user ON data_user.login_id=user.id");

	 			if(mysqli_num_rows($result)==0){
	 				echo '<tr><td colspan="5" align="center">Belum Ada Data</td></tr>';
	 			}
	 			else{
	 				while($isi = mysqli_fetch_assoc($result)){
	 					echo "<tr>";
	 						echo "<td>".$isi['no']."</td>";
	 						echo "<td>".$isi['nama']."</td>";
	 						echo "<td>".$isi['jk']."</td>";
	 						echo "<td>".$isi['tgl_lahir']."</td>";
	 						echo "<td>".$isi['login_id']."</td>";
	 						echo "<td><a href=\"update.php?no=$isi[no]\">Update</a> | <a href=\"hapus.php?no=$isi[no]\">Hapus</a>";
	 					echo "</tr>";
	 				}
	 			}

	 		 ?>
	 	</table>
	 </body>
 </html>

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).