<?php
$host = 'localhost'; // or 127.0.0.1
$db = 'godsonin_sunrediant';
$user = 'godsonin_sunredi';
$pass = 'Sunrediant@123'; // make sure this is accurate
$charset = 'utf8mb4';

$dsn = "mysql:host=$host;dbname=$db;charset=$charset";

try {
    $conn = new PDO($dsn, $user, $pass);
    // set error mode to exception
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    // echo "Database connected successfully";
} catch (PDOException $e) {
    die("Database connection failed: " . $e->getMessage());
}
?>
