title: How to retain a choice of dynamic dropdown box after submit form
body: <p>How to retain a choice of dynamic dropdown box after submit form</p>
  
  <pre><code>&lt;select name="sector_id" id="country" class="input-block-level" style="background-color: #EAF0F5;" &gt;
              &lt;option value=""&gt;&lt;font size='7' face='arabic typesetting' color='red'&gt;chose&lt;/font&gt;&lt;/option&gt;
              &lt;?php
              if($rowCount &gt; 0){
                  while($row = $query-&gt;fetch_assoc()){
  
                      echo '&lt;option value="'.$row['sector_id'].'"&gt;'.$row['sector_name'].'&lt;/option&gt;';
                  }
              }else{
                  echo '&lt;option value=""&gt;not available&lt;/option&gt;';
              }
              ?&gt;
          &lt;/select&gt;
  </code></pre>