Created
December 25, 2019 08:22
-
-
Save 333crist/b5bcf240af754d4f2b0104a9e78ad385 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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