PEAR in XAMPP
Hello, I am trying to connect to a database using the following PEAR syntax:
include('db_login.php');
require_once('DB.php');
# $db_username, $db_password, $db_host, and $db_database are all specified # in db_login.php, which is fine
$connection = DB::connect("mysql://$db_username:$db_password@db_host/$db_database");
if(DB::isError($connection))
{
die("Could not connecto to the database: <br />" . DB::errorMessage($connection));
}
MySQL and Apache were both running before trying out this script.
I did this earlier with regular php fine. Does anyone see what the problem is? Do I need to specify a path for my require_once statement? I've verified my syntax and the return values of the PEAR functions.
By the way, currently my php files are in htdocs. If I wanted to put them in a subfolder what configuration files do I need to change? Thanks.
|