summaryrefslogtreecommitdiff
path: root/db.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-09-14 03:41:44 +0100
committerAndrew Dolgov <[email protected]>2005-09-14 03:41:44 +0100
commit6b3bce8abb502778b813f01dac10bbb7d61b4922 (patch)
tree57748c24041edebea7fcd08889500cb016ce4196 /db.php
parent6995e024ed3af78bd0d15bdc4a0f73555eaf30e3 (diff)
patch (from h3) to connect to PGSQL through unix socket
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);