X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ab6a99677293c9ddb96a717f03b8a009e98ab955..dd7912ff55b68944070b0bb5e3649baff2584878:/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) {