 <p>You should use set_error_handler() to check the error return from the SQL call. For instance:</p> <pre><code>set_error_handler( "NormalErrorHandler" ) ; function NormalErrorHandler( $errno, $errstr, $errfile, $errline ) { $ErrType = DecodeErrno( $errno ) ; $Backtrace = debug_backtrace() ; // The first item in debug_backtrace() is this function, so no use printing it unset( $Backtrace[ 0 ] ) ; $FullError = "Server: {$_SERVER['SERVER_NAME']}\nIP: {$_SERVER['REMOTE_ADDR']}\n" . "$ErrType: $errstr\nLine: $errline\nFile: $errfile\n" . "debug_backtrace():\n" . print_r( $Backtrace, TRUE ) . "GLOBALS:\n" . print_r( $GLOBALS, TRUE ) ; die( $FullError ) ; } </code></pre>