Merge pull request #43 from lekoala/patch-1

return 0 for non iterable results
This commit is contained in:
Damian Mooyman 2018-04-16 09:08:06 +12:00 committed by GitHub
commit c346e64590
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,6 +58,11 @@ class SQLite3Query extends Query
*/ */
public function numRecords() public function numRecords()
{ {
// Some queries are not iterable using fetchArray like CREATE statement
if (!$this->handle->numColumns()) {
return 0;
}
$this->handle->reset(); $this->handle->reset();
$c=0; $c=0;
while ($this->handle->fetchArray()) { while ($this->handle->fetchArray()) {