I have been having a problem with connecting to a database.
I have chased the problem down, and found out that DB.php is not being included for some reason.
Heres my code:
<?php
// The pear base directory must be in your include_path
echo "This is above DB.php";
require_once 'DB.php';
echo "This is below DB.php";
$user = 'username';
$pass = 'password';
$host = 'localhost';
$db_name = 'database';
// Data Source Name: This is the universal connection string
$dsn = "mysql://$user:$pass@$host/$db_name";
// DB::connect will return a Pear DB object on success
// or a Pear DB Error object on error
// You can also set to TRUE the second param
// if you want a persistent connection:
// $db = DB::connect($dsn, true);
$db = DB::connect($dsn);
// With DB::isError you can differentiate between an error or
// a valid connection.
if (DB::isError($db)) {
die ($db->getMessage());
}
?>
This is above DB.php will display on the screen, but not
This is below DB.php
Any help is greatly appreciated.