<?php
/**
 * Shared PDO bootstrap using config/database.php
 */

$dbConfig = require __DIR__ . '/../config/database.php';

try {
    $pdo = new PDO(
        "mysql:host={$dbConfig['host']};dbname={$dbConfig['dbname']};charset={$dbConfig['charset']}",
        $dbConfig['username'],
        $dbConfig['password'],
        $dbConfig['options']
    );
} catch (PDOException $e) {
    error_log('DB connection failed: ' . $e->getMessage());
    die("We're experiencing technical difficulties. Please try again later.");
}
