in your code, query the database and output each row as a select option.
$query = "select course_id, course_name from courses";
print "<select>";
....get_results and loop through them....
{
print "<option value=$course_id>$course_name</option>";
}
print "</select>";
of course, this is very simplified