0% found this document useful (0 votes)
19 views3 pages

Index 1234

Uploaded by

Syerlie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Index 1234

Uploaded by

Syerlie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

<?

php

//=============================================================
//Latihan Dasar-dasar Database (CRUD)
//Programmer By Teuku Radillah, M.Kom
//Latihan - 4
//Simpan file dengan nama index.php didalam folder latihan-4
//==============================================================

// Koneksi Ke database memanggil pada halaman function.php


require 'functions.php';

//Ambil data dari tabel siswa/ query data siswa


// $result = mysqli_query($conn, "SELECT * FROM tbl_siswa");
$siswa = query("SELECT * FROM tbl_siswa");

?>

<!DOCTYPE html >


<html >
<head>
<title>Halaman Admin</title>
</head>

<body>
<h1> Daftar Siswa </h1>

<a href="tambah.php">Tambah Data Siswa </a>


<br><br>
<table border="1" cellpadding="10" cellspacing="0">

<tr>
<td>No.</td>
<td>Aksi</td>
<td>Gambar</td>
<td>NIS</td>
<td>Nama</td>
<td>Email</td>
<td>Jurusan</td>
</tr>
<?php
$i = 1 ;
?>

<?php
foreach($siswa as $row):
?>
<tr>
<td><?=$i;?></td>
<!-- <td>1</td> -->
<td>
<a href="" >Ubah</a> |
<a href="hapus.php?id=<?= $row["id"];?>">Hapus</a>
</td>
<!-- <td><img src="img/tera1.jpeg" width ="70"></td> -->
<td><img src="img/<?php echo $row["gambar"];?>" width ="70"></td>
<td> <?= $row ["nis"]; ?></td>
<td> <?= $row ["nama"]; ?></td>
<td> <?= $row["email"];?></td>
<td> <?= $row ["jurusan"]; ?></td>
</tr>
<?php $i++;?>
<?php endforeach; ?>
</table>
</body>
</html>

You might also like