I am having a problem with updating some values in my database. When I want to change a value using a drop down box, it automatically puts in the first value in the dropdown menu. What I want is to get the value that is already set in the database.
Here is my code:
<select name="vrijwilligerID">
<?php
$vrijwilligerID = $_POST["vrijwilligerID"];
$query = "SELECT voornaam, achternaam, vrijwilligerID FROM vrijwilliger;";
$result = mysql_query($query);
while($row=mysql_fetch_array($result)){
echo "<option value=".$row['vrijwilligerID'].">".$row["voornaam"]." ".$row["achternaam"]."</option>";
}
?>
</select>
Does anyone know how to get this right? Thank you in advance.