title: Distinct results from mysql database as a drop down list / php
body: <p>I'm sure i posted this last night, but I can't find it, and my account says I've asked 0 questions. anyway...</p>
  
  <p>I have a field in my MySQL Database that contains UK Counties. I'd like to list these in a drop down box so they may be selected by a user, to select the area of the UK they'd like to see results from.</p>
  
  <p>I have this so far... but my drop down box appears empty?</p>
  
  <p>any help greatly appreciated.</p>
  
  <pre><code>&lt;?php
  include 'connect.php';
  
  //set variable
  $option = '';
  
  // Get the county names from database - no duplicates
  $query = "SELECT DISTINCT tradingCounty FROM offers";
  
  // execute the query, $result will hold all of the Counties in an array
  $result = mysqli_query($con,$query);
  
  
  while($row = mysql_fetch_array($result)) {
      $option .="&lt;option&gt;" . $row['tradingCounty'] . "&lt;/option&gt;";
      echo $option;
  }
  
  echo "&lt;form id='filter' name='filter' method='post' action='resultssimple.php'&gt;
          &lt;p&gt;&lt;label&gt;County&lt;/label&gt;&lt;/p&gt;
          &lt;select name='filter' id='filter'&gt;" . $option . "&lt;/select&gt;
          &lt;/form&gt;";
  ?&gt;
  </code></pre>