<?php
define('DB_HOST', 'localhost');
define('DB_NAME', 'mehdionl_portal_db');
define('DB_USER', 'mehdionl_portal_db');
define('DB_PASS', 'Mehdi@101010');

try {
    $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);
    $pdo->exec("SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci");
    $pdo->exec("SET CHARACTER SET utf8mb4");
} catch(PDOException $e) {
    die("Connection failed: " . $e->getMessage());
}
?>