diff options
author | Andrew Dolgov <[email protected]> | 2005-09-14 03:41:44 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-09-14 03:41:44 +0100 |
commit | 6b3bce8abb502778b813f01dac10bbb7d61b4922 (patch) | |
tree | 57748c24041edebea7fcd08889500cb016ce4196 /db.php | |
parent | 6995e024ed3af78bd0d15bdc4a0f73555eaf30e3 (diff) |
patch (from h3) to connect to PGSQL through unix socket
Diffstat (limited to 'db.php')
-rw-r--r-- | db.php | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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); |