Code Duplication    Length = 10-11 lines in 2 locations

main/inc/lib/events.lib.php 1 location

@@ 1207-1216 (lines=10) @@
1204
                        orig_lp_item_id = 0
1205
                ORDER BY exe_id";
1206
        $res = Database::query($sql);
1207
        if ($get_count) {
1208
            $row = Database::fetch_array($res, 'ASSOC');
1209
            return $row['count'];
1210
        } else {
1211
            $list = array();
1212
            while ($row = Database::fetch_array($res, 'ASSOC')) {
1213
                $list[$row['exe_id']] = $row;
1214
            }
1215
            return $list;
1216
        }
1217
    }
1218
1219
    /**

main/inc/lib/sessionmanager.lib.php 1 location

@@ 3617-3627 (lines=11) @@
3614
        $result = Database::query($sql);
3615
        $num_rows = Database::num_rows($result);
3616
        $courses = array();
3617
        if ($num_rows > 0) {
3618
            if ($getCount) {
3619
                $count = Database::fetch_assoc($result);
3620
3621
                return intval($count['count']);
3622
            }
3623
3624
            while ($row = Database::fetch_array($result, 'ASSOC')) {
3625
                $courses[$row['real_id']] = $row;
3626
            }
3627
        }
3628
3629
        return $courses;
3630
    }