Code Duplication    Length = 4-5 lines in 2 locations

main/inc/local.inc.php 1 location

@@ 1036-1040 (lines=5) @@
1033
            $sql = "SELECT * FROM $group_table
1034
                    WHERE c_id = ".$_course['real_id']." AND id = '$gidReq'";
1035
            $result = Database::query($sql);
1036
            if (Database::num_rows($result) > 0) { // This group has recorded status related to this course
1037
                $gpData = Database::fetch_array($result);
1038
                $_gid = $gpData ['id'];
1039
                Session::write('_gid', $_gid);
1040
            }
1041
        }
1042
    }
1043
}

main/forum/forumfunction.inc.php 1 location

@@ 5249-5252 (lines=4) @@
5246
                  poster_id = ".intval($user_id)." AND visible = 1 ";
5247
    $result = Database::query($sql);
5248
    $count = 0;
5249
    if (Database::num_rows($result) > 0) {
5250
        $count = Database::fetch_array($result);
5251
        $count = $count['count'];
5252
    }
5253
5254
    return $count;
5255
}