title: PHP - display/hide dropdown list due to selection
body: <p>i have a drop down list called "courses" with options ( math101 , eng102 .. etc)
  and i want to put another drop down list called ( student name ) but this one should be hidden , so when user select one value from the courses list , the student name's list will now appear to show the students names that only taken this course so the user can pick one .. of course all the data will be taken from the database </p>
  
  <p>my code so far is </p>
  
  <pre><code>&lt;?php
  
     include('../connect.php');
     $id=$_SESSION['login_user'];
  
  
  
        $sql = "SELECT CourseName from Course ";
           $result = mysql_query ($sql, $connection);
  
           echo "&lt;tr&gt;&lt;th&gt;Course Name &lt;/th&gt;";
           echo "&lt;td&gt;&lt;select id='CourseName' name='v1' &gt;";
          while( $row = mysql_fetch_array($result))
     {
          echo "&lt;option value='$row[CourseName]' selected='selected'&gt;$row[CourseName]&lt;/option&gt; ";
  
     }
       echo "&lt;/select&gt;";
       echo "&lt;/td&gt;";
       echo "&lt;/tr&gt;" ;
  
  
    $sql = "SELECT StudentName from Student ";
           $result = mysql_query ($sql, $connection);
  
           echo "&lt;tr&gt;&lt;th&gt;Student Name &lt;/th&gt;";
           echo "&lt;td&gt;&lt;select id='StudentName' name='v2' &gt;";
          while( $row = mysql_fetch_array($result))
     {
          echo "&lt;option value='$row[StudentName]' selected='selected'&gt;$row[StudentName]&lt;/option&gt; ";
  
     }
       echo "&lt;/select&gt;";
       echo "&lt;/td&gt;";
       echo "&lt;/tr&gt;" ;
  
  
  
  
       echo "&lt;/table&gt;" ;
       echo "&lt;/font&gt;" ;
  
      ?&gt;
  </code></pre>
  
  <p>my two tables are </p>
  
  <p>Course: CourseName var(30)
          CourseID   int(7)</p>
  
  <p>Student: StudentName var(40)
           Student ID int(7)
           CourseID   int(7)</p>
  
  <p>so my question is , how to make "student name" a hide drop down list depends on 'course' list , so when user choose one course it appear all students names who are taken this course ( by course id ) ?</p>