query($sql); if ($result->num_rows > 0) { echo "
ID Desa | ID Kecamatan | Jumlah 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 " |