note 14634 deleted from function.trigger-error by philip
| From: | philip@php.net | Date: | Fri, 04 Mar 2005 07:01:21 +0000 |
| Subject: | note 14634 deleted from function.trigger-error by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-85906@lists.php.net to get a copy of this message | ||
Note Submitter: StarLight->slt at municipium dot com dot pl
----
Yeah, but when You have Your Brand New Custom Error Handler which emails You, the Boss and Your cat
when an error occures it's not a good idea ;) Or, You may want to know what happens later after
the error - it sometimes helps. But, I too use it often, because my error handler displays a nice
magic box with description etc. ;)
I've found trigger_error very helpful in checking mysql calls. For example:
$result=mysql_query($query) or trigger_error("MySQL error nr ".mysql_errno().":
".mysql_error());
which gives a very nice result if the query is invalid or fails for some reason (i.e. malicious
users trying to send surprises for Your query through Your GET variables ;). Without this, You would
get a strange message saying sth. like this: "supplied argument is not a valid mysql result
resource" a few lines later where You would normally call all Your fancy fetchdata routines ;).