Files
website/includes/dbh.inc.php
masiv_ 676888af5a
Some checks failed
Website Sync / website-sync (push) Failing after 5s
Database secrecy added
2026-02-04 14:56:46 -03:00

19 lines
507 B
PHP

<?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();
}