#23720 [Opn->Fbk]: DB::Connect does not accept string for $dsn when using pgsql
| From: | lsmith@php.net | Date: | Tue, 20 May 2003 15:12:38 +0000 |
| Subject: | #23720 [Opn->Fbk]: DB::Connect does not accept string for $dsn when using pgsql | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16514@lists.php.net to get a copy of this message | ||
ID: 23720
Updated by: lsmith@php.net
Reported By: brian at onlineinfo dot net
-Status: Open
+Status: Feedback
Bug Type: PEAR related
Operating System: Debian, Solaris
PHP Version: 4.3.1
-Assigned To:
+Assigned To: lsmith
New Comment:
Are you trying to switch the dsn after object creation with the factory
method? This feature is not supported as far as I know.
DB_pgsql::connect() should not be called by the user.
Previous Comments:
------------------------------------------------------------------------
[2003-05-20 10:01:44] 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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23720&edit=1