if(isset($_GET['list'])){
$dj=mysqli_query($db, "SELECT * FROM gallery where kategori='".antimaling($_GET['id_kategori'])."' order by id_gallery desc");
$dj2=mysqli_fetch_array(mysqli_query($db, "SELECT * FROM gallery_kategori where id_kategori='".antimaling($_GET['id_kategori'])."'"));
echo "
";
$i = 0;
while ($list=mysqli_fetch_array($dj)){
$images="";
// Tampilkan data ke kolom kanan selama $i >= kolom
echo "
$images
";
}
echo "
";
}else{
$dj=mysqli_query($db, "SELECT * FROM gallery_kategori order by kategori asc");
$kolom = 5;
echo "
";
$i = 0;
while ($list=mysqli_fetch_array($dj)){
$gambar=mysqli_fetch_array(mysqli_query($db, "SELECT * FROM gallery where kategori='$list[id_kategori]' order by RAND()"));
if ($gambar['photo']==""){
$images="";
}else{
$images="";
}
echo "