just one
what you want to do is to take the list of countries from a DB table ( makes it real easy) and then get the data for the user
<?
$sql_country="select * from tbl_country";
$result=mysql_query($sql_country);
$sql_userdata ="select * from tbl_users where userid = $userid";
$result2=mysql_query($sql_userdata);
do while ($row=mysql_fetch_row($result2)){
//assign data to a var - assume store country ID code
$countryofresidence=$row['country'];
}
//lets create the box
echo "<select name=\'country\'>";
//loop through the data for select box
do while ($rows=mysql_etch_array($result)){
$countryid = $rows['country_id'];
$country=$rows['countryname'];
if ($countryofresidence==$countryid){
echo "<option value=\'$countryid\' SELECTED>$country</option>";
}else{
echo "<option value=\'$countryid\'>$country</option>";
}
} // end do loop for select box
?>
hth