I have a page that lists countries from a drop down menu then assigns the selected value (two letter country code) to $country, this form then passes its variables to a new form for verification before submission. I want to keep the countrycode as the value (for that is how I want it stored in the dbase) but SHOW the actual country name in the table on the review page.
here is what I have:
<OPTION VALUE="<?php echo $country; ?>" SELECTED>
<?php
$db = mysql_connect("hostnamet","username","password");
mysql_select_db("databasename",$db);
$result = mysql_query("SELECT countryname FROM country WHERE countrycode=$country",$db);
echo $result;
?>
</OPTION>
countryname is the field I WANT, country is the table name, and countrycode is the VALUE attribute in the previous form.
yet, when I select a country and it throws me to the review page there is just a blank spot for the selected value in country. everything else seems to work fine with no errors.
suggestions, ideas.
I am probably doing something simple wrong, but can't figure it out.
thanks,
/frank