<?php
// db.php
$host = 'localhost';
$db   = 'dashboard';
$user = 'root';      // Default for XAMPP is 'root'
$pass = 'Bare-Dug-Its9';          // Default for XAMPP is empty string
$charset = 'utf8mb4';

// CHANGED: pgsql -> mysql
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$opt = [
    PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES   => false,
];

try {
    $pdo = new PDO($dsn, $user, $pass, $opt);
} catch (\PDOException $e) {
    // This will print the actual database connection error
    die("Database Connection Failed: " . $e->getMessage());
}
?>