title: recalling dropdown menu from mysql needs unique selections
body: <p>I am learning PHP and MySQL and in doing so I am trying to do a little database driven website. I am tinkering with database driven dropdown form lists and so far can display them on the data entry form, can capture the result and insert it into database and now I am trying to recall the selected item, display it on the update/edit form. So far with the below code I can recall the data into update/edit form on a dropdown list however I want to narrow the selectable items down to just the unique roles. </p>
  
  <p>My code is: </p>
  
  <pre><code>&lt;?php
  
  include $_SERVER['DOCUMENT_ROOT']."/connections/connectdb.php";
  
  $role_query = "SELECT fer_users.id fer_roles_id, fer_roles.description\n"
      . "FROM fer_users\n"
      . "JOIN fer_roles\n"
      . "WHERE fer_users.fer_roles_id=fer_roles.id";
  $role_result = mysqli_query($connection, $role_query);
  ?&gt;
  
  &lt;select name="update_role"&gt;
      &lt;?php 
      while ($role_row = mysqli_fetch_assoc($role_result)) {  
      $role_id=$role_row["fer_roles_id"];
      $role_description=$role_row["description"];
      $selected = ($role_row['fer_roles_id'] == $id);
      echo "&lt;option value=\"$role_id\" ".($selected ? " selected=\"selected\"":"")."&gt;$role_description&lt;/option&gt;";
      }
      ?&gt;
  &lt;/select&gt;  
  </code></pre>
  
  <p>The result of the SQL query is as follows:</p>
  
  <pre><code>id |     role
  -----------------
  8  | Administrator
  16 | Administrator
  9  |     User
  14 |     User
  15 |     User
  </code></pre>
  
  <p>And my drop down list renders as follows:
  <img src="https://i.stack.imgur.com/63Noq.png" alt="enter image description here"></p>
  
  <p>As noted above I need the list in the picture to just show Administrator and User. </p>