Re: PHP/Mysql error handling
| From: | Jason G. | Date: | Tue, 06 Nov 2001 13:47:31 +0000 |
| Subject: | Re: PHP/Mysql error handling | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73594@lists.php.net to get a copy of this message | ||
In short, yes.
I maintain some bigger sites. I created a function diee() - die extended - which will display an error html page that you specify, and email an address that you specify.
mysql_query($sQuery) or
diee("Database Error",
"An error occurred while accessing the database",
mysql_errno().': '.mysql_error()."\n$sQuery")
Note that data from the third param will not be displayed on the webpage. This is so passwords, etc will not be dumped to the user in the event of an error.
The script can be downloaded at:
http://www.ionzoft.com/code/izfc/IZFC_lib_error__standalone.zip
-Jason Garber
IonZoft.com
At 12:47 PM 11/4/2001 +0200, George E. Papadakis wrote:
Hi, Is there any way to make php notify me of any errors through email? I know it may sounds funny, but imagine having this huge site and u just want it to run smoothly but u juct cant check it all the time . If there was a way that php would notify u for a an error on a specific page/line that would make debuggin much easier and without guessing.. So, is it possible? Thanks. -- phaistonian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net