Files
website/includes/dbh.inc.php
masiv_ 70c9908df7
All checks were successful
Website Sync / website-sync (push) Successful in 6s
Fix to function calling
2026-02-04 17:18:43 -03:00

21 lines
499 B
PHP

<?php
declare(strict_types=1);
require_once "var_loading.inc.php";
$host = $_ENV["DB_HOST"];
$protocol = $_ENV["DB_PROTOCOL"];
$dbname = $_ENV["DB_NAME"];
$dsn = $protocol . ":host=" . $host . ";dbname=" . $dbname;
$dbusername = $_ENV["DB_USERNAME"];
$dbpassword = $_ENV["DB_PASSWORD"];
try {
$pdo = new PDO($dsn,$dbusername,$dbpassword);
$pdo->setAttribute(PDO::ERRMODE_EXCEPTION,PDO::ATTR_ERRMODE);
} catch (PDOException $e) {
echo "An error has ocurred: " . $e->getMessage();
}