Re: Simple error handling... but how?
| From: | Brian Clark | Date: | Mon, 08 Jan 2001 22:01:09 +0000 |
| Subject: | Re: Simple error handling... but how? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33332@lists.php.net to get a copy of this message | ||
Hello Diego,
(DF == "Diego Fulgueira") dful@metahogar.com writes:
DF> Ok. This might have been widely discussed already, but I haven't
DF> been able to find useful information about it: How can I present a
DF> customized error page whenever a PHP error or warning ocurrs?
Just suppress errors with @ in front of a function name, and display
your error instead.
Ie:
if(! @mysql_query($query, $link))
{
$errorMsg = 'Unable to update the database record ';
$errorMsg .= 'because: <font color="neonpink">';
$errorMsg .= mysql_error() . '</font>';
print $errorMsg;
}
You get the idea..
-Brian