diff --git a/code/PostgreSQLQuery.php b/code/PostgreSQLQuery.php index 67a6faa..17a4d14 100644 --- a/code/PostgreSQLQuery.php +++ b/code/PostgreSQLQuery.php @@ -62,6 +62,8 @@ class PostgreSQLQuery extends Query while ($row = pg_fetch_array($this->handle, null, PGSQL_NUM)) { yield $this->parseResult($row); } + // Reset so the query can be iterated over again + pg_result_seek($this->handle, 0); } public function numRecords()