initial commit

This commit is contained in:
cindy
2026-06-10 19:20:46 +07:00
commit ec94359f9a
21 changed files with 23023 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
// Set header JSON untuk semua response
header('Content-Type: application/json');
$host = 'localhost';
$user = 'root';
$password = ''; // Pastikan password MySQL Anda
$database = 'webgis';
try {
// Buat koneksi
$conn = new mysqli($host, $user, $password, $database);
// Cek koneksi
if ($conn->connect_error) {
throw new Exception("Koneksi gagal: " . $conn->connect_error);
}
// Set charset
$conn->set_charset("utf8");
} catch (Exception $e) {
// Jika error, tetap kembalikan JSON
echo json_encode([
'status' => 'error',
'message' => $e->getMessage()
]);
exit;
}
?>