Hi all
Quick question.
Is it possible to run a function which sends the mysql_error of a query via email so i can quickly fix the problem if an issue arises?
If so, how would it be done?
Ta muchly
Yes. Quite straightforward if you think about it for a moment:
email_if_query_fails($query) { $result = mysql_query($query); if(!$result) { mail(/*the string returned by mysql_error() to someone*/); } return $result; }
Also note that the [man]error_log/man function has options for logging to an email address.