i'm getting this error "DB Error: connect failed" when running the database connection script below.
i've just manually installed PHP 4.3.11/MySQL 4.0.25/PEAR (latest) on XP SP2 w/ IIS.
it must be some mistake in my install, but after many attempts, i'm unable to figure it out where the problem lies.
i have the MySQL ODBC driver installed and a datasource setup with it.
curious what must be installed right to even get this error message, while wondering what is wrong that is causing me to get it!! 🙂
<?php
require_once 'DB.php'; // require PEAR::DB classes
$db_user = 'hamsay2_user';
$db_pass = '[correct password here]';
$db_host = 'localhost';
$db_name = 'hamsay2_hysdatabase';
$db_engine = 'mysql';
$datasource = $db_engine.'://'.$db_user.':'.$db_pass.'@'.$db_host.'/'.$db_name;
$db = DB::connect($datasource); // attempt connection
// if connection failed show error
if(DB::isError($db)) {
die($db->getMessage());
}
?>