title: i want to display it according to category but i'm stuck
body: <p>i want to display it according to category but i'm stuck..is it ok to use both jquery and php at the same time..sorry im just a noobie..</p>
  
  <pre><code>&lt;select name="category" id="category" &gt;
  &lt;option value="All Student"&gt;All Student&lt;?php echo "(".$count.")";?&gt;&lt;/option&gt;
  &lt;option value="By Name"&gt;By Name&lt;/option&gt;
  &lt;option value="By Date"&gt;By Date&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          $('#category').change(function(){
              if ($(this).val() == 'All Student') {
                  &lt;?php 
                      $query = mysql_query("SELECT * FROM table_student WHERE (teacher_id ='".$_SESSION['idnum']."') ORDER BY firstname");
                      while($row=mysql_fetch_array($query)){         //another way to get the data from database.........
                          $idnum = $row['idnum'];                 //getting the GroupID.....                                 display
                          $firstname = $row['firstname'];
                          $lastname = $row['lastname'];
                          $midname = $row['midname'];
                      }
                  ?&gt;                                                                                                      
                  &lt;table&gt;
                      &lt;td&gt;
                          &lt;p class="my_studz"&gt;&lt;?php echo $firstname ." ".$lastname ." ".$midname?&gt;&lt;/p&gt;
                      &lt;/td&gt;
                  &lt;/table&gt;
                  &lt;?php } ?&gt; 
              } else if ($(this).val() == 'By Name') {
                  &lt;?php 
                      $query = mysql_query("SELECT * FROM table_student WHERE (teacher_id ='".$_SESSION['idnum']."') ORDER BY Date_Created");
                      while($row=mysql_fetch_array($query)){         //another way to get the data from database.........
                          $idnum = $row['idnum'];                 //getting the GroupID.....                                 display
                          $firstname = $row['firstname'];
                          $lastname = $row['lastname'];
                          $midname = $row['midname'];
                      }
                  ?&gt;                                                                                                      
                  &lt;table&gt;
                      &lt;td&gt;
                          &lt;p class="my_studz"&gt;&lt;?php echo $firstname ." ".$lastname ." ".$midname?&gt;&lt;/p&gt;
                      &lt;/td&gt;
                  &lt;/table&gt;
              }
          });
      });
  &lt;/script&gt;
  </code></pre>