title: PHP/HTML Showing selected option in dropdown from sql query
body: <p>I wasn't sure how to title my question, I'm basically asking if anyone knows a better way to approach this. I'm using this function below to show which option is pulled from the DB, I'm wondering if there is a more compact way or better way to do this other than elseif each ID</p>
  
  <pre><code>function access_option($access)
  {
      if ($access == 0)
      {
          echo '&lt;option value="0" selected&gt;Member&lt;/option&gt;
          &lt;option value="1"&gt;Streamer&lt;/option&gt;
          &lt;option value="2"&gt;Moderator&lt;/option&gt;
          &lt;option value="3"&gt;Manager&lt;/option&gt;
          &lt;option value="4"&gt;Administrator&lt;/option&gt;
          &lt;option value="5"&gt;Senior Administrator&lt;/option&gt;';
      }
      elseif ($access == 1)
      {
          echo '&lt;option value="0"&gt;Member&lt;/option&gt;
          &lt;option value="1" selected&gt;Streamer&lt;/option&gt;
          &lt;option value="2"&gt;Moderator&lt;/option&gt;
          &lt;option value="3"&gt;Manager&lt;/option&gt;
          &lt;option value="4"&gt;Administrator&lt;/option&gt;
          &lt;option value="5"&gt;Senior Administrator&lt;/option&gt;';
      }
      elseif ($access == 2)
      {
          echo '&lt;option value="0"&gt;Member&lt;/option&gt;
          &lt;option value="1"&gt;Streamer&lt;/option&gt;
          &lt;option value="2" selected&gt;Moderator&lt;/option&gt;
          &lt;option value="3"&gt;Manager&lt;/option&gt;
          &lt;option value="4"&gt;Administrator&lt;/option&gt;
          &lt;option value="5"&gt;Senior Administrator&lt;/option&gt;';
      }
      elseif ($access == 3)
      {
          echo '&lt;option value="0"&gt;Member&lt;/option&gt;
          &lt;option value="1"&gt;Streamer&lt;/option&gt;
          &lt;option value="2"&gt;Moderator&lt;/option&gt;
          &lt;option value="3" selected&gt;Manager&lt;/option&gt;
          &lt;option value="4"&gt;Administrator&lt;/option&gt;
          &lt;option value="5"&gt;Senior Administrator&lt;/option&gt;';
      }
      elseif ($access == 4)
      {
          echo '&lt;option value="0"&gt;Member&lt;/option&gt;
          &lt;option value="1"&gt;Streamer&lt;/option&gt;
          &lt;option value="2"&gt;Moderator&lt;/option&gt;
          &lt;option value="3"&gt;Manager&lt;/option&gt;
          &lt;option value="4" selected&gt;Administrator&lt;/option&gt;
          &lt;option value="5"&gt;Senior Administrator&lt;/option&gt;';
      }
      elseif ($access == 5)
      {
          echo '&lt;option value="0"&gt;Member&lt;/option&gt;
          &lt;option value="1"&gt;Streamer&lt;/option&gt;
          &lt;option value="2"&gt;Moderator&lt;/option&gt;
          &lt;option value="3"&gt;Manager&lt;/option&gt;
          &lt;option value="4"&gt;Administrator&lt;/option&gt;
          &lt;option value="5" selected&gt;Senior Administrator&lt;/option&gt;';
      }
  }
  </code></pre>
  
  <p>Is this the best way to do it?</p>