#21186 [Opn->Bgs]: Can not connect to Informix with DB::connect

From: Date: Wed, 01 Jan 2003 22:32:59 +0000
Subject: #21186 [Opn->Bgs]: Can not connect to Informix with DB::connect
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-11992@lists.php.net to get a copy of this message
ID: 21186 Updated by: mj@php.net Reported By: ckongsak@hotmail.com -Status: Open +Status: Bogus Bug Type: PEAR related Operating System: linux (redhat 7.0) PHP Version: 4.2.3 New Comment: If assertExtension() fails, PEAR::DB will return DB_ERROR_EXTENSION_NOT_FOUND. But in your example, PEAR::DB returned DB_ERROR_NOSUCHDB. This means that the connection to the server could be established, but that the database was not found. The reason for this is that the DSN, you're using, contains a database name that does not exist. Previous Comments: ------------------------------------------------------------------------ [2002-12-26 01:16:26] ckongsak@hotmail.com When I try to use informix module in PEAR package. And I see that some code is wrong. this below is a source code for generate error. ----------------- $db = DB::connect($dsn, true); if (DB::isError($db)) { die(__FILE__ . ':' . __LINE__ . ' => ' . $db->getMessage()); } ----------------- this is a output about of the source code. ----------------- test.php:40 => DBError: no such database ----------------- After if i investigate in ifx.php, in connect function is wrong (may be) below is a current source code (ifx.php, v1.5) ---------------- if ((!DB::assertExtension('informix')) || (!DB::assertExtension('Informix'))) { return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND); } ---------------- Condition in if statement should use "&&" instead of "||". ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21186&edit=1

« previous php.pear.dev (#11992) next »