View Single Post
Old 07-17-2022, 02:05 PM  
zijlstravideo
Confirmed User
 
zijlstravideo's Avatar
 
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
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
zijlstravideo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote