summaryrefslogtreecommitdiff
path: root/db.php
diff options
context:
space:
mode:
Diffstat (limited to 'db.php')
-rw-r--r--db.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/db.php b/db.php
index d739aa9b2..8614436be 100644
--- a/db.php
+++ b/db.php
@@ -5,7 +5,14 @@ require_once "config.php";
function db_connect($host, $user, $pass, $db) {
if (DB_TYPE == "pgsql") {
- return pg_connect("host=$host dbname=$db user=$user password=$pass");
+ $string = "dbname=$db user=$user password=$pass";
+
+ if ($host) {
+
+ $stripng .= "host=$host";
+ }
+
+ return pg_connect($string);
} else if (DB_TYPE == "mysql") {
$link = mysql_connect($host, $user, $pass);