From 93f88c183c77977da9fd952f7ae7f89c2cd15a1f Mon Sep 17 00:00:00 2001 From: Syariffullah Date: Sat, 13 Jun 2026 11:23:26 +0700 Subject: [PATCH] feat: add database connection file for poverty API using project-level configuration --- api/db_connect.php | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/api/db_connect.php b/api/db_connect.php index 58c199f..92296e2 100644 --- a/api/db_connect.php +++ b/api/db_connect.php @@ -1,26 +1,4 @@ connect_error) { - http_response_code(500); - die(json_encode([ - 'status' => 'error', - 'message' => 'Koneksi database gagal: ' . $conn->connect_error, - ])); -} - -// Set charset -$conn->set_charset('utf8mb4'); - -// Jika di-include oleh file API, biarkan $conn tersedia +// Gunakan koneksi terpusat dari root project +require_once dirname(__DIR__, 2) . '/db_connect.php'; ?>