From 6b3bce8abb502778b813f01dac10bbb7d61b4922 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 14 Sep 2005 03:41:44 +0100 Subject: [PATCH] patch (from h3) to connect to PGSQL through unix socket --- db.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/db.php b/db.php index d739aa9b..8614436b 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); -- 2.39.5