]> git.mxchange.org Git - friendica.git/commitdiff
mv q() to DBA::p()
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Sat, 2 Nov 2019 11:12:29 +0000 (12:12 +0100)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Sat, 2 Nov 2019 11:12:29 +0000 (12:12 +0100)
src/Module/Settings/UserExport.php

index 2a19d5f208ae7acccfefc4907778443758de21fb..d6cd0aabf199b5e18cff68a614675e7500cb4af9 100644 (file)
@@ -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;
        }