使用下拉框对学期进行排序

I'm trying to sort courses based on semester (Fall, Spring, and Both)
PHP:

  <td width="200" bgcolor="#DCDCDC" <strong>Semester Available</strong>
  <select name="selectSemester" id="selectSemester">
      <option>Sort Semester</option>
      <option value="0">Fall</option>
      <option value="1">Spring</option>
      <option value="2">Both</option>
    </select>
  </td>


  SQL:

   if($_POST['selectSemester'] != 0)
   {
   $selectSemester=$_POST['selectSemester'];
    }

It is not clear what you exactly want to do. If you get the courses by an SQL query, you can use

ORDER BY semester

or if you actually want to filter by semester you can use

WHERE semester = $_POST['selectSemester']