i was trying to configure about how to work with <select> tag, when i was stuck with this problem: when i choose the <select> tag with PHP, i just want that that value of the <option> tag on the <select> tag will be the value selected after i submit the form. but the thing is, it will go back to the default value. Just try to look at the code:
<select name="project">
<option value="">-Select one-</option> -->
<?php
while($proj = mysql_fetch_array($qryS)){
$id = $proj['id'];
$project = $proj['project'];
$i = $i + 1;
echo "<option value=\"$i\"";
echo ($i == $id) ? "SELECTED":"";
echo ">" . $project . "</option>";
}
?>
</select>
so this is my code. I try to fetch some data from my database.
anyone can help. I really need your help guys. thanks