title: Show selected value in dropdown php from database
body: <p>This is how I am trying to show the details when editing the form but gettin g error.</p>
  
  <pre><code>&lt;select id="progcode" name="progcode"&gt;
      &lt;option value="0"&gt;-none-&lt;/option&gt;
      &lt;option  value="1" &lt;?php if($progcode == '1') echo 'selected="selected"' ?&gt;&gt;PreS1-AB&lt;/option&gt;
      &lt;option value="2" &lt;?php if($progcode == '2') echo 'selected="selected"' ?&gt; &gt;PreS1-MM&lt;/option&gt;
      &lt;option value="3" &lt;?php if($progcode == '3') echo 'selected="selected"' ?&gt; &gt;TutEng&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>any suggestion will be appreciated. </p>