Databse inclusion
Some checks failed
Website Sync / website-sync (push) Failing after 7s

This commit is contained in:
2026-02-04 15:17:55 -03:00
parent 19de46150c
commit 1b6d0f2d11

19
includes/dbh.inc.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
$host = "${{ secrets.DB_HOST }}";
$protocol = "${{ secrets.DB_PROTOCOL }}";
$dbname = "${{ secrets.DB_NAME }}";
$dsn = $protocol . ":host=" . $host . ";dbname=" . $dbname;
$dbusername = "${{ secrets.DB_USERNAME }}";
$dbpassword = "${{ secrets.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();
}