<?php
$host = "localhost";
$user = "root";
$pass = "";
$db   = "webgis02";

$conn = new mysqli($host, $user, $pass, $db);

if ($conn->connect_error) {
    http_response_code(500);
    echo json_encode([
        'success' => false,
        'message' => 'Koneksi database gagal: ' . $conn->connect_error
    ]);
    exit;
}

// Set charset UTF-8 agar karakter khusus tidak rusak
$conn->set_charset("utf8mb4");
?>