I'm trying to figure out a way to get an email when an error occurs on an internal website.... and mostly on sql errors which cause a die statement to execute.

I guess what I was thinking was to attempt a query and if the query fails, I'd do a redirect to another page, which would mean echoing a meta redirect statement or something... but maybe I'm going about this wrong.

Thoughts?