|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-05-20 10:01 UTC] brian at onlineinfo dot net
When passing a valid DSN to DB::Connect and connecting to pgsql, DB_Pgsql expects the dsn to be an array instead of a string. The result is a broken connect string since PHP will happily treat the string as an array. The solution is to replace:
$this->dsn = $dsninfo;
with:
if (is_array($dsninfo)) {
$this->dsn = $dsninfo;
} else {
$this->dsn = $dsninfo = DB::parseDSN($dsninfo);
}
in the connect method of DB/pgsql.php.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 05:00:02 2025 UTC |
Here is the connect code we are using: $db = DB::factory('pgsql_ex'); if (DB::isError($db)) return $db; $connect = $db->Connect($dsn, $persistent = TRUE); if (DB::isError($connect)) return $connect; $db->setFetchMode(DB_FETCHMODE_ASSOC); $db->setOption('seqname_format','%s'); return $db; (pgsql_ex is a small class extending DB_pgsql that adds a metadata method)