I have to get the selected value from the database into the select box. Please explain the process to me. This is the code. Note that the value of "options" depends on the category.
<?php
$sql = "select * from mine where username = '$user' ";
$res = mysql_query($sql);
while($list = mysql_fetch_assoc($res)){
$category = $list['category'];
$username = $list['username'];
$options = $list['options'];
?>
<input type="text" name="category" value="<?php echo '$category' ?>" readonly="readonly" />
<select name="course">
<option value="0">Please Select Option</option>
<option value="PHP">PHP</option>
<option value="ASP">ASP</option>
</select>
<?php
}
?>
Can someone please help me with this?