NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL error log?

David Mintz dmintz at davidmintz.org
Tue Jul 26 17:21:12 EDT 2005


On Tue, 26 Jul 2005, Nasir Zubair wrote:

> You can probably use your own function to capture those errors. for
> example if you use "or die(mysql_error())" to halt your script,
> replace die() with your function which logs the error and then exits.
>
> Or may be a more elegant solution,
> http://us3.php.net/manual/en/function.set-error-handler.php
>

Plus -- just to make sure Chuck understands -- something like a SQL syntax
error, or a query that fails for some other reason, will not make it into
the mysql error log. As I understand it, the error log is for mysqld's
internal stuff:  when it starts and stops, and critical errors
(http://dev.mysql.com/doc/mysql/en/error-log.html). A failed query is more
like an event in the course of a conversation between the server and a
particular client.

I'll leave it to the big boys to correct me if I'm wrong, or re-state this
in more technically precise terms.


---
David Mintz
http://davidmintz.org/



More information about the talk mailing list