From 0a646577fe679567531cf0692b1f281c32b1e579 Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Thu, 12 Jan 2017 17:08:05 +0000 Subject: [PATCH] FIX: SQLite3Query::seek() failed to return a record --- code/SQLite3Query.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/SQLite3Query.php b/code/SQLite3Query.php index 765ce82..e29a88d 100644 --- a/code/SQLite3Query.php +++ b/code/SQLite3Query.php @@ -47,10 +47,10 @@ class SQLite3Query extends Query { $this->handle->reset(); $i=0; - while ($i < $row && $row = @$this->handle->fetchArray()) { + while ($i <= $row && $result = @$this->handle->fetchArray(SQLITE3_ASSOC)) { $i++; } - return true; + return $result; } /** @@ -58,6 +58,7 @@ class SQLite3Query extends Query */ public function numRecords() { + $this->handle->reset(); $c=0; while ($this->handle->fetchArray()) { $c++;