]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db/table.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 1 Feb 2018 00:57:25 +0000 (00:57 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 1 Feb 2018 00:57:25 +0000 (00:57 +0000)
lib/php/db/table.php

index 9740de95be7a0973c11b613480c2cc4a9b89b5bf..c16b0666024af1a7cfae17f8de2c0eb9e1480c96 100644 (file)
@@ -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;