From 34932e12bf42878c86bb7df6b1cc978746d7f1b0 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sat, 2 Nov 2019 12:12:29 +0100 Subject: [PATCH] mv q() to DBA::p() --- src/Module/Settings/UserExport.php | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/Module/Settings/UserExport.php b/src/Module/Settings/UserExport.php index 2a19d5f208..d6cd0aabf1 100644 --- a/src/Module/Settings/UserExport.php +++ b/src/Module/Settings/UserExport.php @@ -88,23 +88,22 @@ class UserExport extends BaseSettingsModule $table = $match[1]; $result = []; - $r = q($query); - if (DBA::isResult($r)) { - foreach ($r as $rr) { - $p = []; - foreach ($rr as $k => $v) { - switch ($dbStructure[$table]['fields'][$k]['type']) { - case 'datetime': - $p[$k] = $v ?? DBA::NULL_DATETIME; - break; - default: - $p[$k] = $v; - break; - } + $rows = DBA::p($query); + while ($row = DBA::fetch($rows)) { + $p = []; + foreach ($row as $k => $v) { + switch ($dbStructure[$table]['fields'][$k]['type']) { + case 'datetime': + $p[$k] = $v ?? DBA::NULL_DATETIME; + break; + default: + $p[$k] = $v; + break; } - $result[] = $p; } + $result[] = $p; } + DBA::close($rows); return $result; } -- 2.39.5