title: an option already selected on page load in drop down list and also changeble
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3030604/php-pre-select-drop-down-option">PHP - PRE-select drop down option</a>  </p>
  </blockquote>
  
  
  
  <p>I have a situation in my php  project where a user can edit his account. </p>
  
  <p>In editing, there is a city field  which is a drop down list of cities. </p>
  
  <p>I want to already select one city which is in profile before editing(the one which user enter at the time of registration).</p>
  
  <p>Also he is able to change his city by choosing fron drop down list.</p>
  
  <p>Html code:</p>
  
  <pre><code>&lt;div class="search_bar1_txt"&gt;State:&lt;/div&gt;
  &lt;div class="search_bar1"&gt;
  &lt;select class="styled" name="state_trainer"&gt;
   &lt;option&gt;-select-&lt;/option&gt;
   &lt;option&gt;washington&lt;/option&gt;
   &lt;option&gt;perth&lt;/option&gt;
   &lt;option&gt;delhi&lt;/option&gt;
   &lt;option&gt;london&lt;/option&gt;
   &lt;/select&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>on editing I am using this code to fetch current data(city) of user:</p>
  
  <pre><code>&lt;?php
  if(isset($_GET['userid']))
  {
  $sql = "select city from `wp_pelleresuser` where userId =".$_GET['userid'];
  $result = mysql_query($sql);
  $value = mysql_fetch_assoc($result);
  }?&gt;
  </code></pre>
  
  <p>please tell me how can I get already selected one option which is fetch from database. </p>
  
  <p>And also it is changeable.</p>