I have a drop-down menu and i want to select the value pf drop-down if the value is already saved in database for that option.

```
    <select class="form-control" id="category" name="category" required >
                <option value="">Select</option>
                <?
                $category= $rs2->fields['category'];                    
                ?>  
                <option value="1" <? if($category== $rs2->fields['category']) { echo 'selected="selected"'; } ?>> PHP </option>
                <option value="2" <? if($category== $rs2->fields['category']) { echo 'selected="selected"'; } ?>> JAVA </option>
                <option value="3" <? if($category== $rs2->fields['category']) { echo 'selected="selected"'; } ?>> C++ </option>
                <option value="4" <? if($category== $rs2->fields['category']) { echo 'selected="selected"'; } ?>> WordPress </option>
</select>

```

If category type is 3 in database then on page lode the selected value should be C++.