From faac2b8ab13a452b1216f12a379bdb10d86c3af9 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 1 Feb 2018 00:57:25 +0000 Subject: [PATCH] lib/php/db/table.php --- lib/php/db/table.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 9740de95..c16b0666 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -1068,11 +1068,7 @@ Class Table extends nb { #debug($opt); list($sql,$where,$limit,$select_count) = $this->rows_sql($opt); - $st = null; - $cursor = null; - $sql_orig = null; - $fct = function() { return true; }; if ($this->db()->type == 'pgsql') { $sql_orig = $sql; $this->db()->conn->beginTransaction(); @@ -1083,7 +1079,6 @@ Class Table extends nb { } else { $this->db()->conn->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false); - } $st = $this->db()->conn->prepare($sql);#,[PDO::ATTR_ERRMODE => PDO::ERRMODE_SILENT]); @@ -1148,7 +1143,7 @@ Class Table extends nb { } $count = 0; - while ($fct() and $row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) { + while ((empty($fct) or $fct()) and $row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) { $count++; $call = null; -- 2.47.3