From: Andrew Dolgov Date: Wed, 14 Sep 2005 02:41:44 +0000 (+0100) Subject: patch (from h3) to connect to PGSQL through unix socket X-Git-Tag: 1.0.5~11 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=6b3bce8abb502778b813f01dac10bbb7d61b4922;p=tt-rss.git patch (from h3) to connect to PGSQL through unix socket --- 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);