summaryrefslogtreecommitdiff
path: root/inc/database.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/database.php')
-rw-r--r--inc/database.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/inc/database.php b/inc/database.php
index 8ffc9f84..e9780640 100644
--- a/inc/database.php
+++ b/inc/database.php
@@ -4,8 +4,11 @@
global $pdo;
if($pdo) return true;
+ $dsn = DB_TYPE . ':host=' . DB_SERVER . ';dbname=' . DB_DATABASE;
+ if(!empty($dsn))
+ $dsn .= ';' . DB_DSN;
try {
- return $pdo = new PDO(DB_TYPE . ':host=' . DB_SERVER . ';dbname=' . DB_DATABASE, DB_USER, DB_PASSWORD);
+ return $pdo = new PDO($dsn, DB_USER, DB_PASSWORD);
} catch(PDOException $e) {
$message = $e->getMessage();