<?php
// config/db.php
declare(strict_types=1);

$DB_HOST = 'localhost';
$DB_NAME = 'd0455ede';
$DB_USER = 'd0455ede';
$DB_PASS = 'fF8PhxfCibdLBrSxowIo'; // anpassen

$options = [
    PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES   => false,
];

try {
    $pdo = new PDO(
        "mysql:host={$DB_HOST};dbname={$DB_NAME};charset=utf8mb4",
        $DB_USER,
        $DB_PASS,
        $options
    );
} catch (PDOException $e) {
    // In Produktion Logging, keine Details ausgeben
    http_response_code(500);
    echo 'Database connection error.';
    exit;
}
