Re: figuring out DB::connect problems
| From: | Tom von Schwerdtner | Date: | Mon, 26 Aug 2002 22:28:52 +0000 |
| Subject: | Re: figuring out DB::connect problems | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-2198@lists.php.net to get a copy of this message | ||
On Mon, Aug 26, 2002 at 04:36:06PM -0500, jhilbert wrote:
> I am trying to use the PEAR DB module. I am trying to diagnose why my
> DB::connect() call is failing, I assume it is because my DSN is not correct.
> However, it matches the examples given in the documentation.
>
> I am using PHP 4.2.1 on a Windows 98 machine, running MySQL 3.23.41, and
> Apache 1.3.
>
> My code attempting to connect via PEAR is
>
> $dsn = "mysql://jon:jon@flattop/tracker";
> $db = DB::connect($dsn,true);
> if (DB::isError($db)) { die ("DB connection error: " .
> $db->getMessage()); }
>
> The error message I get is"
> "DB connection error: DB Error: not found"
Is mysql support compiled into your php?
Also, try upgrading Pear DB. There was a typo in the code that is fixed in
the current version.
typo in DB.php:
define("DB_ERROR_EXTENSION_NOT_FOUND",-25);
define("DB_ERROR_NOSUCHDB", -25);
I was getting this error when I did not have the proper database support
compiled into PHP.
-T