Trying to connext to MySQL with PEAR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux