?> </option><?php } ?> </select><?php } ?> </div> </td> </tr> <tr> <td class="key">Alasan</td> <td> <select name="a"> <option></option><?php $oAlasan = alasan(); while ($Alasan = mysql_fetch_object($oAlasan)) { ?> <option value="<?php echo $Alasan->kode; ?> " <?php if ($Alasan->kode == $a) { echo "selected"; } ?> ><?php echo $Alasan->keterangan; ?> </option><?php }
function alasan_id($kode_alasan) { $query = alasan("kode = '" . $kode_alasan . "'"); $result = mysql_fetch_object($query); return $result; }