query($sql); if ($result->num_rows > 0) { echo ""; while($row = $result->fetch_assoc()) { echo ""; } echo "
ID DesaID KecamatanJumlah TPS
".$row["id_desa"]."".$row["id_kecamatan"].""; // Uraikan kolom jumlah TPS $jumlah_tps = $row["jumlah_tps"]; for ($i = 1; $i <= $jumlah_tps; $i++) { echo $i; if ($i != $jumlah_tps) { echo ";"; } } echo "
"; } else { echo "0 results"; } $conn->close(); ?>