This commit is contained in:
Monarch055
2026-06-10 22:42:58 +07:00
parent 7ad037bf0a
commit 2a0bb3d637
7 changed files with 182 additions and 8 deletions
+4 -4
View File
@@ -1,8 +1,8 @@
<?php
$host = 'localhost';
$dbname = 'spbu_db'; // Change if your database name is different
$username = 'root'; // Default XAMPP username
$password = ''; // Default XAMPP password is empty
$host = getenv('DB_HOST') ?: 'localhost';
$dbname = getenv('DB_DATABASE') ?: 'spbu_db'; // Change if your database name is different
$username = getenv('DB_USERNAME') ?: 'root'; // Default XAMPP username
$password = getenv('DB_PASSWORD') !== false ? getenv('DB_PASSWORD') : ''; // Default XAMPP password is empty
try {
$pdo = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8mb4", $username, $password);