There is already a very robust logging class
http://pear.php.net/package/Log/ that I find very useful.
Other than that I am not sure what you are looking for, do you want to
show errors that php generates? Do you want to inform the user if a
query was successful or not? What are these errors that are being
generated?