lokeh Posted November 2, 2006 Share Posted November 2, 2006 Hello!Here the current code, im still testing, so forgive me if some vairable names seems strange or something. [code]<? $sqlqueryold = mysql_query("SELECT name,prefix FROM countries WHERE prefix='$info[country]'"); $infoOC = mysql_fetch_array($sqlqueryold, MYSQL_ASSOC); print "<OPTION value=\"$infoOC[prefix]\" selected=\"selected\">x: $infoOC[name]</OPTION>"; $sqlquery = "SELECT name,prefix FROM countries ORDER BY name ASC"; $result = mysql_query($sqlquery); $number = mysql_num_rows($result); $i = 0; if ($number < 1) { print "<p class=\"StandardText\">No countries!</p>"; } else { while ($number > $i) { $co_name = mysql_result($result,$i,"name"); $co_prefix = mysql_result($result,$i,"prefix"); print "<OPTION value=\"$co_prefix\">$co_name</OPTION> \n"; $i++; } } ?>[/code]Now the select works for all intensive purposes. Basically its for a member profile page, where members can update theyre profile, country being one of them. Its correctly retrieving the list of countries from my SQL DB and displaying them to the user in a select drop down box. The Update function is also working and checking shows the country prefix, for example (Brazil = br) is being entered into theyre SQL field in the users profile which is "country". The problem being though, it should be displaying the users current country in the select box, pre selected if you would, when they first load up the "edit profile" page. At the moment, its just displaying the x: prefix, with no country selected like it should. Cheers for any help in advance. Link to comment https://forums.phpfreaks.com/topic/25968-help-regarding-member-country-select/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.