summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics_reporting/inc/queries.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/statistics_reporting/inc/queries.inc.php')
-rw-r--r--modules-available/statistics_reporting/inc/queries.inc.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules-available/statistics_reporting/inc/queries.inc.php b/modules-available/statistics_reporting/inc/queries.inc.php
index 128d8e7d..8c6ff9a8 100644
--- a/modules-available/statistics_reporting/inc/queries.inc.php
+++ b/modules-available/statistics_reporting/inc/queries.inc.php
@@ -106,7 +106,7 @@ class Queries
$bounds = [$lowerTimeBound, $upperTimeBound];
}
$machines = array();
- while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
+ foreach ($res as $row) {
$row['firstseen'] = max($row['firstseen'], $from);
$row += array(
'totalTime' => self::timeDiff($row['firstseen'], $to, $bounds),
@@ -132,7 +132,7 @@ class Queries
ORDER BY dateline ASC LIMIT 1000", compact('last', 'to'));
$last = false;
$count = 0;
- while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
+ foreach ($res as $row) {
$count += 1; // Update count first, as we use it as a condition in outer loop. No continue before this
settype($row['logid'], 'int');
// Update for next query
@@ -375,7 +375,7 @@ class Queries
LEFT JOIN exams_x_location exl USING (examid)
WHERE starttime < $to AND endtime > $from
GROUP BY examid");
- while ($row = $eres->fetch(PDO::FETCH_ASSOC)) {
+ foreach ($eres as $row) {
// Get all boot events
$data = ['from' => $row['starttime'], 'to' => $row['endtime']];
if (empty($row['locs'])) {