title: Set option value from php variable
body: <pre><code>&lt;form method="post" id="employee" action="change.php"&gt;
  &lt;select id="employeename" name="employeename" onchange="this.form.submit()"&gt;
   &lt;?php 
  while ($row = mysql_fetch_array($result))
  {
      echo "&lt;option value='".$row['name']."'&gt;".$row['name']."&lt;/option&gt;";
  }
  ?&gt;    
  &lt;/select&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The form will be submitted when select value is changed,</p>
  
  <p>Once the form is submitted, it will redirect to the same page. How do I set the selected option value with the one I just selected?</p>