Skip to content

Instantly share code, notes, and snippets.

@333crist
Created December 25, 2019 08:22
Show Gist options
  • Save 333crist/b5bcf240af754d4f2b0104a9e78ad385 to your computer and use it in GitHub Desktop.
Save 333crist/b5bcf240af754d4f2b0104a9e78ad385 to your computer and use it in GitHub Desktop.
<?php
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING)); //hilangkan eror
ini_set('max_execution_time', 0); // max execution
$conn = new mysqli("localhost", "root", "", "kristiandes"); //sesuaikan database
?>
<h1>kristiandes.com</h1>
<!-- END HEADER LAYOUT -->
<!-- HEADER TABLE -->
<hr>
<table border=1 width="30%">
<tr>
<th>ID</th>
<th>Nama</th>
<th>Matakuliah</th>
</tr>
<!-- END HEADER TABLE -->
<!-- BODY TABLE -->
<?php
$ssql="SELECT * FROM sample_where_in WHERE matakulian_sample IN ('fisika1,fisika2')";
$hasil = mysqli_query($conn,$ssql);
while($rowac = mysqli_fetch_array($hasil))
{
if(!$rowac)
{
echo "data kosong";
}
else {
//Fetch the details
$id_sample = $rowac['id_sample'];
$nama_sample = $rowac['nama_sample'];
$matakulian_sample = $rowac['matakulian_sample'];
echo "<tr><td>$id_sample</td><td>$nama_sample</td><td>$matakulian_sample</td></td></tr>";
}
}
mysqli_close($conn);
?>
<!-- END BODY TABLE -->
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment