<?php
// Database credentials
$host = 'localhost';
$db   = 'tandddri_Students';
$user = 'tandddri_admin';
$pass = '!S0ngw3av3r1!';
$charset = 'utf8mb4';

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

// PDO options
$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, $user, $pass, $options);
} catch (\PDOException $e) {
    // Stop execution and print error
    die("Database connection failed: " . $e->getMessage());
}
