- Code: Select all
<?php
include('db_login.php');
require_once('DB.php');
$connection = DB::connect("mysql://$db_username:$db_password@db_host/$db_database");
if(DB::isError($connection)) {
die("Could not connect to the database: <br />".DB::errorMessage($connection));
}
?>
The error I get when I run the code is:
- Code: Select all
Could not connect to the database:
connect failed
I can connect to the database just fine using mysql_connect(); this happens only when I use PEAR.
I'm running xampp 1.6.6a, and I have Windows XP SP3. I looked through similar situations in the forum, and closest I could find was an MDB2 pathing issue, which wasn't similar enough for me to adapt the answer.
I'm very new at PHP, but I'll try my best with any help you can give me.