Unified email reports
This commit is contained in:
18
dbconfig.php
18
dbconfig.php
@@ -1,18 +1,18 @@
|
||||
<?php
|
||||
|
||||
$host = "localhost";
|
||||
$username = "root";
|
||||
$password = "";
|
||||
$db = "custom_design";
|
||||
// Use environment variables for Docker deployment
|
||||
$host = getenv('DB_HOST') ?: 'localhost';
|
||||
$username = getenv('DB_USER') ?: 'root';
|
||||
$password = getenv('DB_PASS') ?: '';
|
||||
$db = getenv('DB_NAME') ?: 'custom_designs';
|
||||
$port = getenv('DB_PORT') ?: '3306';
|
||||
|
||||
try{
|
||||
// database connection
|
||||
$conn = new PDO("mysql:host=$host;dbname=$db",$username,$password);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$conn = new PDO("mysql:host=$host;port=$port;dbname=$db", $username, $password);
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
}
|
||||
catch(PDOException $pe)
|
||||
{
|
||||
die('Connection error, because: ' .$pe->getMessage());
|
||||
}
|
||||
|
||||
$baseURL = 'http://'.$_SERVER['HTTP_HOST'] . '/bulacanlibrary/';
|
||||
}
|
||||
Reference in New Issue
Block a user