Forum Moderators: coopster
Let's say $retrieved is your array of data retrieved from your db.
<select name="country" id="country">
<?php foreach ($country as $c){?>
<option value="<?php echo $c['country_id'];?>"
<?php if(isset($retrieved['country_id']) && $retrieved['country_id'] == $c['country_id']) echo "selected = 'selected'";?>
><?php echo ucwords($c['country']);?></option>
</select>