I want to get records from database to fill form for update. I dont have problem with the input fields but for the select option. I want to click on an icon to fetch the data to fill the select option with the selected="selected" base on a specific ID from the db. Please help.
Thanks
<select name="cat_id">
<option></option>
<?php $query = mysql_query("SELECT * FROM account_type");
while($row = mysql_fetch_array($query)) { ?>
<option value="<?php echo$row['cat_id']?>" selected="selected" >
<?php echo$row['category']?></option>;
<?php } ?>
</select>