patch (from h3) to connect to PGSQL through unix socket
This commit is contained in:
parent
6995e024ed
commit
6b3bce8abb
9
db.php
9
db.php
|
@ -5,7 +5,14 @@ require_once "config.php";
|
||||||
function db_connect($host, $user, $pass, $db) {
|
function db_connect($host, $user, $pass, $db) {
|
||||||
if (DB_TYPE == "pgsql") {
|
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") {
|
} else if (DB_TYPE == "mysql") {
|
||||||
$link = mysql_connect($host, $user, $pass);
|
$link = mysql_connect($host, $user, $pass);
|
||||||
|
|
Loading…
Reference in New Issue