What are your thoughts of using the following function to log mysql errors?
<?php
function sql_query($query)
{
$q = mysql_query($query);
if(!$q)
{
mysql_query('INSERT INTO mysql_errors (error_query, error_about) VALUES ('.
$query.', '.mysql_error().' )');
}
return $q;
}
?>
Do you find it useful? How can it be improved?