Re: Help With PEAR::DB Connection
| From: | James Kaufman | Date: | Sat, 11 Sep 2004 12:49:33 +0000 |
| Subject: | Re: Help With PEAR::DB Connection | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196395@lists.php.net to get a copy of this message | ||
On Sat, Sep 11, 2004 at 01:48:43AM -0500, php-list@xenonsolutions.com wrote:
> Hello everyone,
>
> I have a problem connecting to the Database. When I execute the code at the
> bottom, it gives me this message: "DB Error: extension not found". It sees
> the DB file and the parameters are correct. I checked the include path and
> it was correct. Did I do something wrong? Any help would be greatly
> appreciated. Thank you.
>
>
> require_once 'DB.php';
> $user = 'foo';
> $pass = 'bar';
> $host = 'localhost';
> $db_name = 'clients_db';
> $dsn = "mysql://$user:$pass@$host/$db_name";
> $db = DB::connect($dsn);
> if (DB::isError($db)) {
> die ($db->getMessage());
> }
>
> -- Nilaab
>
The message 'extension not found' means that PEAR couldn't find the mysql db
extension. Hmm. In cases like this, create a phpinfo.php file as documented on
this list and see what shows up. Or, you can type at the command prompt: php
-i, then look for the MySQL extension in the output.
Also, you neglected to tell us what OS you are running, etc.
--
Jim Kaufman
Linux Evangelist
public key 0x6D802619
---
A dog teaches a boy fidelity, perseverance, and to turn around three
times before lying down.
-- Robert Benchley