<?php
// Database configuration
$host     = 'localhost'; // Usually 'localhost', change if your host provides a different database server address
$dbname   = 'luckrgur_pakclub';
$username = 'luckrgur_pakclub';
$password = 'luckrgur_pakclub';
$charset  = 'utf8mb4'; // Recommended charset for full Unicode support (including emojis/Urdu text)

// Data Source Name
$dsn = "mysql:host=$host;dbname=$dbname;charset=$charset";

// PDO Options
$options = [
    PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION, // Throw exceptions on errors
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,       // Fetch associative arrays by default
    PDO::ATTR_EMULATE_PREPARES   => false,                  // Use actual prepared statements
];

try {
    // Create a new PDO instance
    $pdo = new PDO($dsn, $username, $password, $options);
} catch (\PDOException $e) {
    // If there is an error, catch it and display a generic message (hiding exact DB details from users)
    die("Database connection failed: " . $e->getMessage());
}
?>