diff options
Diffstat (limited to 'modules-available/statistics/page.inc.php')
-rw-r--r-- | modules-available/statistics/page.inc.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php index 20ff929a..6224d69c 100644 --- a/modules-available/statistics/page.inc.php +++ b/modules-available/statistics/page.inc.php @@ -171,7 +171,7 @@ class Page_Statistics extends Page $ids = array_flip($ids); $allowedMachines = []; $seenLocations = []; - while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + foreach ($res as $row) { unset($ids[$row['machineuuid']]); settype($row['locationid'], 'int'); if (in_array($row['locationid'], $allowedLocations)) { @@ -202,7 +202,7 @@ class Page_Statistics extends Page $res = Database::simpleQuery('SELECT machineuuid, locationid FROM machine WHERE machineuuid IN (:ids)', compact('ids')); $ids = array_flip($ids); $delete = []; - while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + foreach ($res as $row) { unset($ids[$row['machineuuid']]); if (in_array($row['locationid'], $allowedLocations)) { $delete[] = $row['machineuuid']; |