patch (from h3) to connect to PGSQL through unix socket

This commit is contained in:
Andrew Dolgov 2005-09-14 03:41:44 +01:00
parent 6995e024ed
commit 6b3bce8abb
1 changed files with 8 additions and 1 deletions

9
db.php
View File

@ -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);