Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 23307)
+++ wp-includes/wp-db.php	(working copy)
@@ -1199,7 +1199,7 @@
 			$this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
 
 		// If there is an error then take note of it..
-		if ( $this->last_error = mysql_error( $this->dbh ) ) {
+		if ( is_resource( $this->dbh ) && $this->last_error = mysql_error( $this->dbh ) ) {
 			$this->print_error();
 			return false;
 		}
