diff --git a/inc/AwlQuery.php b/inc/AwlQuery.php index af1167ec..9bb3f016 100644 --- a/inc/AwlQuery.php +++ b/inc/AwlQuery.php @@ -502,7 +502,7 @@ class AwlQuery } else $this->error_info = null; } - else if ( $this->sth !== false ) { + else if ( !isset($this->sth) ) { /** Ensure we have a connection to the database */ if ( !isset($this->connection) ) { _awl_connect_configured_database(); @@ -515,6 +515,9 @@ class AwlQuery } else $this->error_info = null; } + else if ( $this->sth === false ) { + $success = false; + } if ( $success ) $this->rows = $this->sth->rowCount(); $t2 = microtime(true); // get end time $i_took = $t2 - $t1;