Update api.php
This commit is contained in:
@@ -4,10 +4,10 @@ header("Content-Type: application/json");
|
|||||||
|
|
||||||
// ── KONFIGURASI DATABASE ──────────────────────────────────────
|
// ── KONFIGURASI DATABASE ──────────────────────────────────────
|
||||||
// ── KONFIGURASI DATABASE ──────────────────────────────────────
|
// ── KONFIGURASI DATABASE ──────────────────────────────────────
|
||||||
$host = getenv('DB_HOST') ?: '127.0.0.1';
|
$host = getenv('DB_HOST') ?: $_ENV['DB_HOST'] ?: $_SERVER['DB_HOST'] ?: '127.0.0.1';
|
||||||
$db = getenv('DB_NAME') ?: 'webgis_poverty';
|
$db = getenv('DB_NAME') ?: $_ENV['DB_NAME'] ?: $_SERVER['DB_NAME'] ?: 'webgis_poverty';
|
||||||
$user = getenv('DB_USER') ?: 'root';
|
$user = getenv('DB_USER') ?: $_ENV['DB_USER'] ?: $_SERVER['DB_USER'] ?: 'root';
|
||||||
$pass = getenv('DB_PASS') ?: '';
|
$pass = getenv('DB_PASS') ?: $_ENV['DB_PASS'] ?: $_SERVER['DB_PASS'] ?: '';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$pdo = new PDO("mysql:host=$host;dbname=$db;charset=utf8mb4", $user, $pass, [
|
$pdo = new PDO("mysql:host=$host;dbname=$db;charset=utf8mb4", $user, $pass, [
|
||||||
|
|||||||
Reference in New Issue
Block a user