I am trying to use a dropdown list and set the value to the one in the databse.
For example if the database holds "Website" I would want this to be the selected option on the dropdown form.
See below code, I have repeated this for each of my products
if($product['product'] = 'Website'){
echo"
<div class='form-group'>
<label for='mail_message'>Product<font color='red'>*</font></label>
<select name='product' id='product' class='form-control' required>
<option value='Website' selected='selected'>Website</option>
<option value='CMS'>CMS</option>
<option value='Domain'>Domain</option>
<option value='Hosting'>Hosting</option>
</select>
</div>
"; }
When i run this code, i have numerous dropdowns showing with each of my products showing as the selected value for each
Can anyone help? (NB)
selectedor not.