Hey. The host I use seem to experience alot of (different) mysql errors, which is resulting in the forum being down Way too much - so I am trying to find something that, when a mysql error occurs, a page of my choice comes up (with the mysql error embedded) for instance, the news archive...
I've made the page already, but I don't know how to go about making the redirect.
I found this script, but don't know if it's compatible with punbb, or even where to put it. Anyone have any ideas?
// Here is the function. This function must be placed before any HTML code or
// else the redirect will not work. You could place it in a separate file and
// use include.
function dbconnect($hostname, $username, $password, $database) {
$conn = @mysql_pconnect($hostname, $username, $password); // "@" is
necessary.
if(!$conn) header("Location: Forum_error.html");
if(!mysql_select_db($database, $conn)) header("Location: Forum_error.html");
}
// This is how to call the function. This must also be placed before any HTML
// code or else the redirect will not work.
dbconnect($host, $user, $pwd, $db);