diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2010-12-18 02:24:27 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2010-12-18 02:24:27 +1100 |
| commit | 796a5445601c187bb7fa867d9c5b152ac8fd9797 (patch) | |
| tree | 968fdbe4572a16452529a1ca6c8920e58b9d2da0 /inc/database.php | |
| parent | ebed5b55dbc29d90b071373aae9c73fa929d0cac (diff) | |
Added DB_DSN
Diffstat (limited to 'inc/database.php')
| -rw-r--r-- | inc/database.php | 5 |
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(); |
