figuring out DB::connect problems
| From: | jhilbert | Date: | Mon, 26 Aug 2002 21:36:06 +0000 |
| Subject: | figuring out DB::connect problems | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-2197@lists.php.net to get a copy of this message | ||
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"
However, I can successfully connect to that database using the dbx_connect
function:
$link = dbx_connect (DBX_ODBC, "", "tracker", "jon", "jon")
or die ("Could not connect");
works just fine.
How can I go about figuring out what's wrong with the DSN? Or is there some
aspect of installation (allowing MySQL connections?) for PEAR that I haven't
done correctly?
Thanks,
Jon Hilbert