View Single Post
Old 07-17-2022, 06:01 PM  
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,123
Quote:
Originally Posted by zijlstravideo View Post
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).
Thank you so much
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote