From 4e9c3dedc5906c597f5cc07e6867b99ff09c5039 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Thu, 18 Mar 2010 22:46:01 +1300 Subject: [PATCH] Fix some screwy logic in AwlQuery for statements with no parameters. --- inc/AwlQuery.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;