it is known to use PEAR in the code and the config file is:
Code: Select all
<?php
function handlePearError($error) {
header('HTTP/1.0 500 Internal Server Error');
//die("$error->message<br />$error->userinfo"); // uncomment this to debug
die('Error ocurred, please try again later');
}
function &db_connect() {
require_once 'DB.php';
$dsn = "mysql://user:pass@unix+localhost/db_name";
$db = DB::connect($dsn);
if (DB::isError($db)) {
die("Database connection failed.");
}
$db->setFetchMode(DB_FETCHMODE_OBJECT);
$db->setErrorHandling(PEAR_ERROR_CALLBACK, 'handlePearError');
return $db;
}
?>
Database connection failed.
why do you think i can't connect to database?
how can i see the error?