mughees ilyas
mughees ilyas

Reputation: 526

course list in combo box

i am trying to get all the courses from database but i guess its not really working can anyone tell me or give me the query to get all courses from data base

    $DB->get_records_menu('quiz', array('course' =>$courseid),'','id, name');
echo '<select name="quizid2" id="combo_3">';
            echo '<option value=" " selected="selected">Choose....</option>';
            foreach($quizzes as $id2 => $name) {
                echo '<option value=' . $id2 . '>' . $name . '</option>';
            }
            echo '</select>';

this is what i am using to get all the quizzes of specific course but somehow i am unable to get the list of all available courses from database i want to list the courses in same way aswell

Upvotes: 0

Views: 97

Answers (1)

sumit
sumit

Reputation: 332

you can use get_courses() to fetch all courses of site or any category.

Upvotes: 1

Related Questions