title: Select Box option filter
body: <p>Is the following code wrong here? </p>
  
  <p>I have a three option select box for different select queries for displaying data. I can't seem to get it to work. 
  The form is submitted with a submit button with a name and value of submit. 
  Do I need to check the select box name as well?</p>
  
  <pre><code>if(isset($_POST['submit'])) {
    if($_POST['value']=='all_records') {
      $sql = "SELECT *
          FROM contact_list
          ";
    }
    elseif($_POST['value']=='surname_desc') {
      $sql = "SELECT *
              FROM contact_list
              ORDER BY Surname DESC";
    }
    else{
      $sql = "SELECT *
              FROM contact_list
              ORDER BY FirstName ASC";
    }
  $results = mysqli_query($dblink, $sql) or die (mysqli_error());
  }
  </code></pre>
  
  <p>My form:</p>
  
  <pre><code>  &lt;form class="filteroption" action="" method="post"&gt;
            &lt;select class="select" name="select"&gt;
              &lt;option value ="all_records" selected="selected"&gt;All  records&lt;/option&gt;
              &lt;option value ="surname_desc" selected="selected"&gt;Surname  Desc&lt;/option&gt;
              &lt;option value ="firstname_asc" selected="selected"&gt;First Name   Asc&lt;/option&gt;
            &lt;/select&gt;
              &lt;input  class="" type="submit" name="submit" value="submit"&gt;
            &lt;/form&gt;
  </code></pre>
  
  <p>The queries aren't working and changing the content of my table. I am echoing out from $results into thr table using foreach etc, which seems to work fine with the default pre query view of the page... </p>