<?php
require __DIR__ . '/../vendor/autoload.php';

$dotenv = Dotenv\Dotenv::createImmutable('/var/www/html/confs/dpmy_dev/');
$dotenv->load();

$DB_HOST = $_ENV['DB_HOST'];
$DB_PORT = $_ENV['DB_PORT'];
$DB_NAME = $_ENV['DB_DATABASE'];
$DB_USER = $_ENV['DB_USERNAME'];
$DB_PASS = $_ENV['DB_PASSWORD'];

$db = new PDO("mysql:host=$DB_HOST;dbname=$DB_NAME;charset=utf8mb4",$DB_USER,$DB_PASS,[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);


// try {
//     $pdo = new PDO(
//         "mysql:host=$DB_HOST;dbname=$DB_NAME;charset=utf8mb4",
//         $DB_USER,
//         $DB_PASS,
//         [
//             PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
//         ]
//     );
//     echo "Connessione al database riuscita!";
// } catch (PDOException $e) {
//     echo "Errore connessione DB: " . $e->getMessage();
// }
