<?php
declare(strict_types=1);
ini_set('display_errors','1'); // turn off later
error_reporting(E_ALL);

// Use 127.0.0.1 on shared hosts
$DB_HOST = '127.0.0.1';
$DB_NAME = 'loyaqono_sonia';      // <-- your cPanel DB name
$DB_USER = 'loyaqono_sonia_user';      // <-- your cPanel DB user
$DB_PASS = 'Fantom25@@';// <-- the password you set

$dsn = "mysql:host={$DB_HOST};dbname={$DB_NAME};charset=utf8mb4";

try {
    $pdo = new PDO($dsn, $DB_USER, $DB_PASS, [
        PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
        PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
        PDO::ATTR_EMULATE_PREPARES   => false,
    ]);
} catch (PDOException $e) {
    http_response_code(500);
    exit('DB connection failed: ' . $e->getMessage());
}
