Files
webgis-poverty-mapping/debug_ambil.php
T
2026-06-04 21:28:53 +07:00

33 lines
899 B
PHP

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
echo "=== CEK KONEKSI ===" . PHP_EOL;
include 'koneksi.php';
if (!$conn) {
echo "KONEKSI GAGAL: " . mysqli_connect_error() . PHP_EOL;
exit;
}
echo "Koneksi OK, class: " . get_class($conn) . PHP_EOL;
echo "DB: webgis" . PHP_EOL . PHP_EOL;
echo "=== CEK TABEL ===" . PHP_EOL;
$tables = ['tabel_ibadah', 'tabel_penduduk'];
foreach ($tables as $t) {
$r = $conn->query("SHOW TABLES LIKE '$t'");
echo "$t: " . ($r && $r->num_rows > 0 ? "ADA" : "BELUM ADA") . PHP_EOL;
}
echo PHP_EOL . "=== CEK PREPARE ===" . PHP_EOL;
$s = $conn->prepare("SELECT id FROM tabel_ibadah LIMIT 1");
if ($s === false) {
echo "prepare() GAGAL: " . $conn->error . PHP_EOL;
} else {
echo "prepare() OK" . PHP_EOL;
$s->close();
}
echo PHP_EOL . "=== CEK ob_start CONFLICT ===" . PHP_EOL;
echo "ob_get_level: " . ob_get_level() . PHP_EOL;