<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<h3 align="center">DATA SISWA</h3>
<table width="800" border="2" align="center" cellpadding="2" cellspacing="2">
<tr>
<td align="center" bgcolor="#CCCCCC">NIS</td>
<td align="center" bgcolor="#CCCCCC">NAMA</td>
<td align="center" bgcolor="#CCCCCC">KELAS</td>
<td align="center" bgcolor="#CCCCCC">JURUSAN</td>
<td align="center" bgcolor="#CCCCCC">FOTO</td>
</tr>
</form>
<?php
//koneksi ke database
include("koneksi.php");
//membuka database data_siswa
mysql_select_db("data_siswa");
$a="select*from tabel_siswa order by nis";
$b=mysql_query($a);
while($c=mysql_fetch_row($b)){
echo"
<tr>
<td>$c[1]</td>
<td>$c[2]</td>
<td>$c[3]</td>
<td>$c[4]</td>
<td>$c[5]</td>
</tr>";}
?>
</table>
<div align="center">
</form>
<p><a href="form_siswa.php">Tambah Data</a>\<a href="edit_siswa.php">Edit Data</a>\<a href="hapus_siswa.php">Hapus Data</a></p>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<h3 align="center">DATA SISWA</h3>
<table width="800" border="2" align="center" cellpadding="2" cellspacing="2">
<tr>
<td align="center" bgcolor="#CCCCCC">NIS</td>
<td align="center" bgcolor="#CCCCCC">NAMA</td>
<td align="center" bgcolor="#CCCCCC">KELAS</td>
<td align="center" bgcolor="#CCCCCC">JURUSAN</td>
<td align="center" bgcolor="#CCCCCC">FOTO</td>
</tr>
</form>
<?php
//koneksi ke database
include("koneksi.php");
//membuka database data_siswa
mysql_select_db("data_siswa");
$a="select*from tabel_siswa order by nis";
$b=mysql_query($a);
while($c=mysql_fetch_row($b)){
echo'
<tr>
<td>'.$c[1].'</td>
<td>'.$c[2].'</td>
<td>'.$c[3].'</td>
<td>'.$c[4].'</td>
<td><img src="foto/'.$c[5].'"/></td> <!-- jika gambar disimpan di folder foto -->
</tr>';
}
?>
</table>
<div align="center">
</form>
<p><a href="form_siswa.php">Tambah Data</a>\<a href="edit_siswa.php">Edit Data</a>\<a href="hapus_siswa.php">Hapus Data</a></p>
</div>
</body>
</html>