note 5777 deleted from die by ronabop
| From: | ronabop@php.net | Date: | Sat, 12 Aug 2000 21:41:03 +0000 |
| Subject: | note 5777 deleted from die by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-1586@lists.php.net to get a copy of this message | ||
HI Folks, with die you can also call a function.
eg. :
mysql_query("xxxx") or die mysql_error();
You can use your own function like :
function errmailer()
{
global x;
$err=mysql_error();
echo "There is an error";
mail("a@b.com","error message n $x","$err","from :
c@d.com");
}
and then you can give a command at a desired place like
mysql_query("xxxx") or die errmailer();
This can be useful quite a lot for debugging errors when they happen through unknown users and
through unkbown events trigerred by the user unknowingly