Skip to content

Instantly share code, notes, and snippets.

@Aziz-Rahman
Created December 10, 2015 03:17
Show Gist options
  • Save Aziz-Rahman/a7033cf3f5558a658c23 to your computer and use it in GitHub Desktop.
Save Aziz-Rahman/a7033cf3f5558a658c23 to your computer and use it in GitHub Desktop.
selectopt
<select name="txtkd_unit">
<option value='0'> pilih unit </option>
<?php
$tampil=mysql_query("select * from unit");
while ($r=mysql_fetch_array($tampil)){
echo "<option value='{$r['kd_unit']}'".($hsl['kd_unit']==$r['kd_unit']?" selected":"").">{$r['nama_unit']}</option>";
}
?>
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment