pdo->prepare('SELECT `key`, `value` FROM thresholds WHERE device_id = ?'); $st->execute([$deviceId]); $out = []; foreach ($st->fetchAll() as $row) { $out[$row['key']] = $row['value']; } return $out; } }