Get the value from your database:
SQL query... select from xxxx where user etc...
Store it in a variable, for example $usersearchOption = '';
Put the options in an array:
$searchOptions = array('Google','Bing','Yahoo','YoMomma');
Loop through options in array, if a match with the database entry, add "selected":
foreach ($searchOptions as $value)
{
if($value == $usersearchOption) echo "<option selected='selected' value='".$value".'>".$value."</option>";
else {
echo "<option value='".$value."'>".$value."</option>";
} // end of else
} // end loop
Then, add a submit button below and update the new value in database (if the user submitted a change).
__________________
 Contact: email
|