Jump to content

Chaning a Database Default Answer


kenwvs

Recommended Posts

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.