Hi again,
Heres something i found at linuxguruz.org, that may be usefull:
# First create a MySQL error handing function
# Call this file mysql_error.inc
#
<?
function this_error () {
$url = "
http://www.linuxguruz.org"; // Your URL goes here
$doc = "error.html"; // Error doc name
$errno = mysql_errno();
$error = urlencode(mysql_error());
$day = urlencode(date("l dS of F Y h:i a"));
include "$url/$doc?errno=$errno&error=$error&today=$day";
}
?>
# Next create a test page
# Call this file test.html
#
<HTML><BODY><?
include "mysql_error.inc";
@mysql_select_db("nonexistentDB")
or die(this_error());
?></BODY></HTML>
# Now create a the page the user will be directed to
# Call this file error.html
#
<HTML><BODY>
<HEAD>
<META HTTP-EQUIV=REFRESH
CONTENT="10;URL=http://www.linuxguruz.org">
</HEAD>
<?
$fp = popen("/usr/sbin/sendmail -t", "w");
$num = fputs($fp, "To: webmaster@linuxguruz.org\n");
$num += fputs($fp, "From: MySQL_ERROR\n");
$num += fputs($fp, "Subject: MySQL Error Submition\n\n");
$message = "Error Number: $errno\n";
$message .= "Error Cause: $error\n";
$message .= "Date: $today\n";
$num += fputs($fp, "$message");
pclose($fp); ?>
<CENTER><B>
A error has occured while proccesing your request
</B></CENTER>
<A HREF="mailto:webmaster@linuxguruz.org">
webmaster@linuxguruz.org </A>has been notified.<P>
You will be returned to our Main site in 10 seconds.
</BODY></HTML>
# Lastly customize the error page to best meet your sites
# needs. You need to change the 5 occurances of the domain
# linuxguruz.org to your own domain name. As you can see
# the error.html file is very configurable and I am shure
# you can see the possibilities.