kenwvs Posted July 22, 2006 Share Posted July 22, 2006 I know absolutely nothing about this, but am hoping to make a minor change in a program. I have an online auction site and when a member registers, or lists an item for the auction, one of the fields is Country. In that spot, it says "Please Select Country". You then choose from a list of countries, which has pretty much all the countries I could think of, plus some. I would like to change it so that the default country is Canada. I know the code for Canada is "32", just like the code for the USA is "210". In the database, there is a table called "Countries" which has all the countries listed, along with their country code. I have tried setting this to "32" for a default, but it made no difference. I don't know if there would be another setting in there that I need to change. In the code itself, there is some various spots, where they have put a "0" which refers to the "Please Select Category" or invalid entry. I have tried changing the numbers in this general area around, and again it makes no difference.I am not sure if I need to change it in the DB or if it would be in the script that I need to change it. Here is an example of the membership form that they complete (the portion relating to country). Not sure if that tells you anything as to where I should be looking to set the default.[code] <TR> <TD width="44%" height="25" align=left valign="top" class="innertablestyle"><font class="normal"><B>Country<br> </B></font></TD> <TD width="6" align=left valign="top"><font class="normal"><FONT class=red>*</font></FONT></TD> <TD> <SELECT name="sb_country"> <OPTION value=0 <? if($sb_country==0) {echo " selected ";}?>>Select a country <? $country1=mysql_query("select * from sbauctions_country order by country"); while($rst= mysql_fetch_array($country1)) { ?> <OPTION value=<? echo $rst["id"];?> <? if($rst["id"]==$sb_country) {echo " selected ";}?>><? echo $rst["country"];?></OPTION> <? } // wend ?> </SELECT> </TD> </TR>[/code]thanks in advance,Ken Quote Link to comment https://forums.phpfreaks.com/topic/15363-chaning-a-database-default-answer/ Share on other sites More sharing options...
king arthur Posted July 23, 2006 Share Posted July 23, 2006 This is not a MySQL question.Somewhere in your script you need to set the variable $sb_country to the value you want, then the country corresponding to that value will be selected by default in the menu. Quote Link to comment https://forums.phpfreaks.com/topic/15363-chaning-a-database-default-answer/#findComment-62237 Share on other sites More sharing options...
kenwvs Posted July 23, 2006 Author Share Posted July 23, 2006 Thanks for sending me in the right direction.Ken Quote Link to comment https://forums.phpfreaks.com/topic/15363-chaning-a-database-default-answer/#findComment-62246 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.