<?php
$host = 'uo484gsokg8w0k8k0cc44wws';
$dbname = 'default';
$username = 'mysql';
$password = 'Mkb5XNQivkTqKLP7APALxHMj2S5gGYJ7uC52kN3RhT0n9ZVqy66JRLEvjp1T4wVy';

try {
    $db = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8mb4", $username, $password);
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
} catch (PDOException $e) {
    http_response_code(500);
    echo json_encode(['status' => 'error', 'message' => 'Koneksi database gagal: ' . $e->getMessage()]);
    exit;
}