<?php
// WARNING: Is <?php se upar koi space nahi hona chahiye!
error_reporting(E_ALL);
ini_set('display_errors', 1);

try {
    if (session_status() === PHP_SESSION_NONE) {
        session_start();
    }

    define('DB_HOST', 'localhost');
    define('DB_USER', 'utqgpyjt_45win8279'); 
    define('DB_PASS', 'utqgpyjt_45win8279'); 
    define('DB_NAME', 'utqgpyjt_45win8279'); 
    define('APP_NAME', 'GameHub Premium');

    // Check if PDO is actually enabled
    if (!class_exists('PDO')) {
        die("CRITICAL ERROR: PDO Extension is OFF in cPanel. Please turn it ON.");
    }

    $pdo = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME.";charset=utf8mb4", DB_USER, DB_PASS);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);

} catch (Throwable $e) {
    // Ye line 500 Error aane se rokegi aur asli reason batayegi
    die("Config Error: " . $e->getMessage() . " on line " . $e->getLine());
}
?>