<?php
echo "<form action=\"dodelete.php\" method=\"post\">
<table border=1>
<tr>
<th><input type=\"checkbox\" /></th>
<th>No.</th>
<th>Nama</th>
<th>jkelamin</th>
<th>Kelas</th>
</tr>";
$no = 1;
$mysqli = new mysqli('localhost', 'root', '', 'mydb');
$sql = $mysqli->query("SELECT idsiswa,nama,jkelamin,kelas from siswa order by nama");
if($sql->num_rows>0){
while($data = mysqli_fetch_array($sql)){
echo "<tr>
<td><input type=\"checkbox\" name=\"del[]\" value=\"$data[idsiswa]\" /></td>
<td>$no.</td>
<td>$data[nama]</td>
<td>$data[jkelamin]</td>
<td>$data[kelas]</td>
</tr>";
$no++;
}
}
echo "</table>
<input type=\"submit\" name=\"do\" value=\"Hapus yang dipilih\" />
</form>";
?>