Trying to connext to MySQL with PEAR
| From: | Jason Davis | Date: | Thu, 06 Jan 2005 15:41:33 +0000 |
| Subject: | Trying to connext to MySQL with PEAR | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-38008@lists.php.net to get a copy of this message | ||
Hi all I am new to PHP and am trying to connect to mysql for the first time.
I get activity on the mysql monitor when I run it, but get the following
error.
DB Error: connect failed
The lines of code are:
require_once( "DB.php" );
$dsn =
"mysql://".DB_USER.":".DB_PASS."@".DB_SERVER."/".DB_NAME;
echo $dsn;
$isPersistant = TRUE;
$db = DB::connect($dsn, $isPersistant);
if ( DB::isError( $db ) ) {
die ($db->getMessage());
}
The constants are properly defined and passing through to this page (checked
with echo), the database is created, the user has an account, and the
account has rights to do all funcitons on the db. Any thoughts on what might
be wrong?
Thanks
Jason