It's a good idea to disable error handling on all functions which rely on an external resource such as database or a filesystem. You candisable error handling by prefixing an (@) symbol next to your function call.
Most functions which use external resources will return a specific value on faliure such as -1. You can test the functions return value after exectution and determine whether or not an error has occured and take the appropriate action. You can also retrieve the error message text using the $php_errormsg global variable (nb: requires the track_errors directive to be turned on in the PHP ini file).
Below is such an expamle, where by a query is executed on a mySql database:
$result = @mysql_query("SELECT * FROM mytable");
if (! $result) {
// function failed - do some error handling
}
As you can see the function will return 0 if it fails. Normally it would return a number that can then be used to get more information on the query.