<?php
$host = '127.0.0.1';
$port = '3306';
$db   = 'webspark_clothstore';
$user = 'webspark_udara';
$pass = 'Flashback123'; // Standard MAMP password
$charset = 'utf8mb4';







$dsn = "mysql:host=$host;port=$port;dbname=$db;charset=$charset";
$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, $user, $pass, $options);
} catch (\PDOException $e) {
     // If database doesn't exist, we might want to handle it, 
     // but for now we assume it exists after running database.sql
     die("Connection failed: " . $e->getMessage());
}
?>
