<?php
// pass any error messages triggered to error handler
error_reporting(E_ALL);
include('adodb-errorhandler.inc.php');
include('adodb.inc.php');
// suppress error messages for the connection
ini_set("display_errors", "0");
try {
$mydb = &ADONewConnection('mysql');
$mydb->PConnect('dbhost','dbuser','dbpass','dbname');
} catch (exception $e) {
// unable to connect to the DB (usually too many connections), redirect away
header('Location: /error.html');
exit();
}