diff --git a/code/SQLite3Query.php b/code/SQLite3Query.php index e29a88d..2d77d31 100644 --- a/code/SQLite3Query.php +++ b/code/SQLite3Query.php @@ -58,6 +58,11 @@ class SQLite3Query extends Query */ public function numRecords() { + // Some queries are not iterable using fetchArray like CREATE statement + if (!$this->handle->numColumns()) { + return 0; + } + $this->handle->reset(); $c=0; while ($this->handle->fetchArray()) {