Hello everyone,
I have a problem with my drop down list box on my edit page in php. I would like my drop down list box to show what the user has selected, then if the user wishes to, change their selection updating the DB(mysql) at the same time. I have a couple of radio buttons that does the same thing and works fine.
eg <?php if ($dataArow['garageopt'] == "yes"){ echo ' checked="checked"';}?> />
When i try to apply the same method changing the checked=checked to selected it doesen't work.
<select name="cartype" />
<option value="<?php if ($dataArow['cartype'] == "tvr"){ echo ' selected="selected"';}?>" />tvr</option>
<option value="<?php if ($$dataArow['cartype'] == "lexus"){ echo 'selected';}?>"/>lexue</option>
<option value="<?php if ($$dataArow['cartype'] == "porche"){ echo 'selected';}?>"/></option>
</select>
Can somebody help me please it would be much appreciated.
Thanks.