<?php
// config/database.php
$db_host = 'localhost'; // atau 'localhost'
$db_name = 'db_mms26'; // Sesuai dengan file .sql Anda
$db_user = 'root';        // User database XAMPP default
$db_pass = '';            // Password database XAMPP default

$dsn = "mysql:host=$db_host;dbname=$db_name;charset=utf8mb4";
$options = [
    PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES   => false,
];

try {
    $pdo = new PDO($dsn, $db_user, $db_pass, $options);
} catch (PDOException $e) {
    throw new PDOException($e->getMessage(), (int)$e->getCode());
}
?>