is working good not an issue. if in case say for example the stored values is section_2 ok, later if i want it to update with section 1 then the section 1 is not displayed in the dropdown . i want to display section 1 as well as section 2, how i can fix the issue ?
<select name="type">
<?php foreach($data as $row){ ?>
<option value="<?php echo $row->ID ?>"><?php echo $row->type ?></option>
<option value="Section_2">Section 2</option>
<?php } ?>
</select>
try this
<?php if(your_edit_value =='section_1'){?>
<option value="section_1" selected>section_1</option>
<?php } else {?>
<option value="section_1">section_1</option>
<?php if(your_edit_value =='Section_2'){?>
<option value="Section_2" selected>Section 2</option>
<?php }else { ?>
<option value="Section_2">Section 2</option>
<?php }?>
</select>