<?php
$host = 'localhost';
$dbname = 'macsoftlabsco_pioneers';
$username = 'macsoftlabsco';
$password = 'S6x0Widn}trK^NN';
$charset = 'utf8mb4';

$dsn = "mysql:host={$host};dbname={$dbname};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, $username, $password, $options);
} catch (PDOException $e) {
    http_response_code(500);
    echo '<h1>Database connection failed</h1>';
    echo '<p>Please update <code>includes/database_connection.php</code> with the correct credentials.</p>';
    exit;
}
