Code Duplication    Length = 10-11 lines in 2 locations

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

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

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

@@ 3507-3517 (lines=11) @@
3504
        $result = Database::query($sql);
3505
        $num_rows = Database::num_rows($result);
3506
        $courses = array();
3507
        if ($num_rows > 0) {
3508
            if ($getCount) {
3509
                $count = Database::fetch_assoc($result);
3510
3511
                return intval($count['count']);
3512
            }
3513
3514
            while ($row = Database::fetch_array($result,'ASSOC'))	{
3515
                $courses[$row['real_id']] = $row;
3516
            }
3517
        }
3518
3519
        return $courses;
3520
    }