X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ab6a99677293c9ddb96a717f03b8a009e98ab955..a46c739ffb1801c83a86b4776c70a3e9cb0440c6:/lib/db.php diff --git a/lib/db.php b/lib/db.php index 4f7336c1..b6dc89c4 100644 --- a/lib/db.php +++ b/lib/db.php @@ -1,15 +1,21 @@ getMessage(), 'Unable to connect to the database'); + // Get the database object + $oDB =& DB::connect(CONST_Database_DSN.($bNew?'?new_link=true':''), $bPersistent); + if (PEAR::IsError($oDB)) + { + var_dump(CONST_Database_DSN); + var_Dump($oDB); + fail($oDB->getMessage()); + } + $oDB->setFetchMode(DB_FETCHMODE_ASSOC); + $oDB->query("SET DateStyle TO 'sql,european'"); + $oDB->query("SET client_encoding TO 'utf-8'"); + return $oDB; } - $oDB->setFetchMode(DB_FETCHMODE_ASSOC); - $oDB->query("SET DateStyle TO 'sql,european'"); - $oDB->query("SET client_encoding TO 'utf-8'"); function getDBQuoted($s) {