From 9995867f1d5bf4328f395bad3f7dc29675703e7a Mon Sep 17 00:00:00 2001 From: james Date: Thu, 28 Aug 2008 21:41:31 +0000 Subject: [PATCH] Add countries table and populate Add countries_code field to provinces table and fix canadian provinces Populate US States into provinces table Add config option to Localization tab to enter a 2 letter country code (how to lookuup from countries table?!) Update emit_province_selector to use country config entry --- common.inc.php | 2 +- db/db.code.version.txt | 2 +- db/db.update.113.sql | 329 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 331 insertions(+), 2 deletions(-) create mode 100644 db/db.update.113.sql diff --git a/common.inc.php b/common.inc.php index e5f1a4c..fd58b2d 100644 --- a/common.inc.php +++ b/common.inc.php @@ -822,7 +822,7 @@ function emit_time_selector($name,$selected="") function emit_province_selector($name,$selected="",$extra="") { global $config; - $q=mysql_query("SELECT * FROM provinces ORDER BY province"); + $q=mysql_query("SELECT * FROM provinces WHERE countries_code='".mysql_escape_string($config['country'])."' ORDER BY province"); if(mysql_num_rows($q)==1) { $r=mysql_fetch_object($q); diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 194b81c..9b252fd 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -112 +113 diff --git a/db/db.update.113.sql b/db/db.update.113.sql new file mode 100644 index 0000000..61a8f2c --- /dev/null +++ b/db/db.update.113.sql @@ -0,0 +1,329 @@ +CREATE TABLE `countries` ( + `code` VARCHAR( 2 ) NOT NULL, + `country` VARCHAR( 64 ) NOT NULL, + UNIQUE (`code`) +) TYPE = MYISAM; +INSERT INTO `countries` (country,code) VALUES ('AFGHANISTAN','AF'); +INSERT INTO `countries` (country,code) VALUES ('ÅLAND ISLANDS','AX'); +INSERT INTO `countries` (country,code) VALUES ('ALBANIA','AL'); +INSERT INTO `countries` (country,code) VALUES ('ALGERIA','DZ'); +INSERT INTO `countries` (country,code) VALUES ('AMERICAN SAMOA','AS'); +INSERT INTO `countries` (country,code) VALUES ('ANDORRA','AD'); +INSERT INTO `countries` (country,code) VALUES ('ANGOLA','AO'); +INSERT INTO `countries` (country,code) VALUES ('ANGUILLA','AI'); +INSERT INTO `countries` (country,code) VALUES ('ANTARCTICA','AQ'); +INSERT INTO `countries` (country,code) VALUES ('ANTIGUA AND BARBUDA','AG'); +INSERT INTO `countries` (country,code) VALUES ('ARGENTINA','AR'); +INSERT INTO `countries` (country,code) VALUES ('ARMENIA','AM'); +INSERT INTO `countries` (country,code) VALUES ('ARUBA','AW'); +INSERT INTO `countries` (country,code) VALUES ('AUSTRALIA','AU'); +INSERT INTO `countries` (country,code) VALUES ('AUSTRIA','AT'); +INSERT INTO `countries` (country,code) VALUES ('AZERBAIJAN','AZ'); +INSERT INTO `countries` (country,code) VALUES ('BAHAMAS','BS'); +INSERT INTO `countries` (country,code) VALUES ('BAHRAIN','BH'); +INSERT INTO `countries` (country,code) VALUES ('BANGLADESH','BD'); +INSERT INTO `countries` (country,code) VALUES ('BARBADOS','BB'); +INSERT INTO `countries` (country,code) VALUES ('BELARUS','BY'); +INSERT INTO `countries` (country,code) VALUES ('BELGIUM','BE'); +INSERT INTO `countries` (country,code) VALUES ('BELIZE','BZ'); +INSERT INTO `countries` (country,code) VALUES ('BENIN','BJ'); +INSERT INTO `countries` (country,code) VALUES ('BERMUDA','BM'); +INSERT INTO `countries` (country,code) VALUES ('BHUTAN','BT'); +INSERT INTO `countries` (country,code) VALUES ('BOLIVIA','BO'); +INSERT INTO `countries` (country,code) VALUES ('BOSNIA AND HERZEGOVINA','BA'); +INSERT INTO `countries` (country,code) VALUES ('BOTSWANA','BW'); +INSERT INTO `countries` (country,code) VALUES ('BOUVET ISLAND','BV'); +INSERT INTO `countries` (country,code) VALUES ('BRAZIL','BR'); +INSERT INTO `countries` (country,code) VALUES ('BRITISH INDIAN OCEAN TERRITORY','IO'); +INSERT INTO `countries` (country,code) VALUES ('BRUNEI DARUSSALAM','BN'); +INSERT INTO `countries` (country,code) VALUES ('BULGARIA','BG'); +INSERT INTO `countries` (country,code) VALUES ('BURKINA FASO','BF'); +INSERT INTO `countries` (country,code) VALUES ('BURUNDI','BI'); +INSERT INTO `countries` (country,code) VALUES ('CAMBODIA','KH'); +INSERT INTO `countries` (country,code) VALUES ('CAMEROON','CM'); +INSERT INTO `countries` (country,code) VALUES ('CANADA','CA'); +INSERT INTO `countries` (country,code) VALUES ('CAPE VERDE','CV'); +INSERT INTO `countries` (country,code) VALUES ('CAYMAN ISLANDS','KY'); +INSERT INTO `countries` (country,code) VALUES ('CENTRAL AFRICAN REPUBLIC','CF'); +INSERT INTO `countries` (country,code) VALUES ('CHAD','TD'); +INSERT INTO `countries` (country,code) VALUES ('CHILE','CL'); +INSERT INTO `countries` (country,code) VALUES ('CHINA','CN'); +INSERT INTO `countries` (country,code) VALUES ('CHRISTMAS ISLAND','CX'); +INSERT INTO `countries` (country,code) VALUES ('COCOS (KEELING) ISLANDS','CC'); +INSERT INTO `countries` (country,code) VALUES ('COLOMBIA','CO'); +INSERT INTO `countries` (country,code) VALUES ('COMOROS','KM'); +INSERT INTO `countries` (country,code) VALUES ('CONGO','CG'); +INSERT INTO `countries` (country,code) VALUES ('CONGO, THE DEMOCRATIC REPUBLIC OF THE','CD'); +INSERT INTO `countries` (country,code) VALUES ('COOK ISLANDS','CK'); +INSERT INTO `countries` (country,code) VALUES ('COSTA RICA','CR'); +INSERT INTO `countries` (country,code) VALUES ('CÔTE D\'IVOIRE','CI'); +INSERT INTO `countries` (country,code) VALUES ('CROATIA','HR'); +INSERT INTO `countries` (country,code) VALUES ('CUBA','CU'); +INSERT INTO `countries` (country,code) VALUES ('CYPRUS','CY'); +INSERT INTO `countries` (country,code) VALUES ('CZECH REPUBLIC','CZ'); +INSERT INTO `countries` (country,code) VALUES ('DENMARK','DK'); +INSERT INTO `countries` (country,code) VALUES ('DJIBOUTI','DJ'); +INSERT INTO `countries` (country,code) VALUES ('DOMINICA','DM'); +INSERT INTO `countries` (country,code) VALUES ('DOMINICAN REPUBLIC','DO'); +INSERT INTO `countries` (country,code) VALUES ('ECUADOR','EC'); +INSERT INTO `countries` (country,code) VALUES ('EGYPT','EG'); +INSERT INTO `countries` (country,code) VALUES ('EL SALVADOR','SV'); +INSERT INTO `countries` (country,code) VALUES ('EQUATORIAL GUINEA','GQ'); +INSERT INTO `countries` (country,code) VALUES ('ERITREA','ER'); +INSERT INTO `countries` (country,code) VALUES ('ESTONIA','EE'); +INSERT INTO `countries` (country,code) VALUES ('ETHIOPIA','ET'); +INSERT INTO `countries` (country,code) VALUES ('FALKLAND ISLANDS (MALVINAS)','FK'); +INSERT INTO `countries` (country,code) VALUES ('FAROE ISLANDS','FO'); +INSERT INTO `countries` (country,code) VALUES ('FIJI','FJ'); +INSERT INTO `countries` (country,code) VALUES ('FINLAND','FI'); +INSERT INTO `countries` (country,code) VALUES ('FRANCE','FR'); +INSERT INTO `countries` (country,code) VALUES ('FRENCH GUIANA','GF'); +INSERT INTO `countries` (country,code) VALUES ('FRENCH POLYNESIA','PF'); +INSERT INTO `countries` (country,code) VALUES ('FRENCH SOUTHERN TERRITORIES','TF'); +INSERT INTO `countries` (country,code) VALUES ('GABON','GA'); +INSERT INTO `countries` (country,code) VALUES ('GAMBIA','GM'); +INSERT INTO `countries` (country,code) VALUES ('GEORGIA','GE'); +INSERT INTO `countries` (country,code) VALUES ('GERMANY','DE'); +INSERT INTO `countries` (country,code) VALUES ('GHANA','GH'); +INSERT INTO `countries` (country,code) VALUES ('GIBRALTAR','GI'); +INSERT INTO `countries` (country,code) VALUES ('GREECE','GR'); +INSERT INTO `countries` (country,code) VALUES ('GREENLAND','GL'); +INSERT INTO `countries` (country,code) VALUES ('GRENADA','GD'); +INSERT INTO `countries` (country,code) VALUES ('GUADELOUPE','GP'); +INSERT INTO `countries` (country,code) VALUES ('GUAM','GU'); +INSERT INTO `countries` (country,code) VALUES ('GUATEMALA','GT'); +INSERT INTO `countries` (country,code) VALUES ('GUERNSEY','GG'); +INSERT INTO `countries` (country,code) VALUES ('GUINEA','GN'); +INSERT INTO `countries` (country,code) VALUES ('GUINEA-BISSAU','GW'); +INSERT INTO `countries` (country,code) VALUES ('GUYANA','GY'); +INSERT INTO `countries` (country,code) VALUES ('HAITI','HT'); +INSERT INTO `countries` (country,code) VALUES ('HEARD ISLAND AND MCDONALD ISLANDS','HM'); +INSERT INTO `countries` (country,code) VALUES ('HOLY SEE (VATICAN CITY STATE)','VA'); +INSERT INTO `countries` (country,code) VALUES ('HONDURAS','HN'); +INSERT INTO `countries` (country,code) VALUES ('HONG KONG','HK'); +INSERT INTO `countries` (country,code) VALUES ('HUNGARY','HU'); +INSERT INTO `countries` (country,code) VALUES ('ICELAND','IS'); +INSERT INTO `countries` (country,code) VALUES ('INDIA','IN'); +INSERT INTO `countries` (country,code) VALUES ('INDONESIA','ID'); +INSERT INTO `countries` (country,code) VALUES ('IRAN, ISLAMIC REPUBLIC OF','IR'); +INSERT INTO `countries` (country,code) VALUES ('IRAQ','IQ'); +INSERT INTO `countries` (country,code) VALUES ('IRELAND','IE'); +INSERT INTO `countries` (country,code) VALUES ('ISLE OF MAN','IM'); +INSERT INTO `countries` (country,code) VALUES ('ISRAEL','IL'); +INSERT INTO `countries` (country,code) VALUES ('ITALY','IT'); +INSERT INTO `countries` (country,code) VALUES ('JAMAICA','JM'); +INSERT INTO `countries` (country,code) VALUES ('JAPAN','JP'); +INSERT INTO `countries` (country,code) VALUES ('JERSEY','JE'); +INSERT INTO `countries` (country,code) VALUES ('JORDAN','JO'); +INSERT INTO `countries` (country,code) VALUES ('KAZAKHSTAN','KZ'); +INSERT INTO `countries` (country,code) VALUES ('KENYA','KE'); +INSERT INTO `countries` (country,code) VALUES ('KIRIBATI','KI'); +INSERT INTO `countries` (country,code) VALUES ('KOREA, DEMOCRATIC PEOPLE\'S REPUBLIC OF','KP'); +INSERT INTO `countries` (country,code) VALUES ('KOREA, REPUBLIC OF','KR'); +INSERT INTO `countries` (country,code) VALUES ('KUWAIT','KW'); +INSERT INTO `countries` (country,code) VALUES ('KYRGYZSTAN','KG'); +INSERT INTO `countries` (country,code) VALUES ('LAO PEOPLE\'S DEMOCRATIC REPUBLIC','LA'); +INSERT INTO `countries` (country,code) VALUES ('LATVIA','LV'); +INSERT INTO `countries` (country,code) VALUES ('LEBANON','LB'); +INSERT INTO `countries` (country,code) VALUES ('LESOTHO','LS'); +INSERT INTO `countries` (country,code) VALUES ('LIBERIA','LR'); +INSERT INTO `countries` (country,code) VALUES ('LIBYAN ARAB JAMAHIRIYA','LY'); +INSERT INTO `countries` (country,code) VALUES ('LIECHTENSTEIN','LI'); +INSERT INTO `countries` (country,code) VALUES ('LITHUANIA','LT'); +INSERT INTO `countries` (country,code) VALUES ('LUXEMBOURG','LU'); +INSERT INTO `countries` (country,code) VALUES ('MACAO','MO'); +INSERT INTO `countries` (country,code) VALUES ('MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF','MK'); +INSERT INTO `countries` (country,code) VALUES ('MADAGASCAR','MG'); +INSERT INTO `countries` (country,code) VALUES ('MALAWI','MW'); +INSERT INTO `countries` (country,code) VALUES ('MALAYSIA','MY'); +INSERT INTO `countries` (country,code) VALUES ('MALDIVES','MV'); +INSERT INTO `countries` (country,code) VALUES ('MALI','ML'); +INSERT INTO `countries` (country,code) VALUES ('MALTA','MT'); +INSERT INTO `countries` (country,code) VALUES ('MARSHALL ISLANDS','MH'); +INSERT INTO `countries` (country,code) VALUES ('MARTINIQUE','MQ'); +INSERT INTO `countries` (country,code) VALUES ('MAURITANIA','MR'); +INSERT INTO `countries` (country,code) VALUES ('MAURITIUS','MU'); +INSERT INTO `countries` (country,code) VALUES ('MAYOTTE','YT'); +INSERT INTO `countries` (country,code) VALUES ('MEXICO','MX'); +INSERT INTO `countries` (country,code) VALUES ('MICRONESIA, FEDERATED STATES OF','FM'); +INSERT INTO `countries` (country,code) VALUES ('MOLDOVA, REPUBLIC OF','MD'); +INSERT INTO `countries` (country,code) VALUES ('MONACO','MC'); +INSERT INTO `countries` (country,code) VALUES ('MONGOLIA','MN'); +INSERT INTO `countries` (country,code) VALUES ('MONTENEGRO','ME'); +INSERT INTO `countries` (country,code) VALUES ('MONTSERRAT','MS'); +INSERT INTO `countries` (country,code) VALUES ('MOROCCO','MA'); +INSERT INTO `countries` (country,code) VALUES ('MOZAMBIQUE','MZ'); +INSERT INTO `countries` (country,code) VALUES ('MYANMAR','MM'); +INSERT INTO `countries` (country,code) VALUES ('NAMIBIA','NA'); +INSERT INTO `countries` (country,code) VALUES ('NAURU','NR'); +INSERT INTO `countries` (country,code) VALUES ('NEPAL','NP'); +INSERT INTO `countries` (country,code) VALUES ('NETHERLANDS','NL'); +INSERT INTO `countries` (country,code) VALUES ('NETHERLANDS ANTILLES','AN'); +INSERT INTO `countries` (country,code) VALUES ('NEW CALEDONIA','NC'); +INSERT INTO `countries` (country,code) VALUES ('NEW ZEALAND','NZ'); +INSERT INTO `countries` (country,code) VALUES ('NICARAGUA','NI'); +INSERT INTO `countries` (country,code) VALUES ('NIGER','NE'); +INSERT INTO `countries` (country,code) VALUES ('NIGERIA','NG'); +INSERT INTO `countries` (country,code) VALUES ('NIUE','NU'); +INSERT INTO `countries` (country,code) VALUES ('NORFOLK ISLAND','NF'); +INSERT INTO `countries` (country,code) VALUES ('NORTHERN MARIANA ISLANDS','MP'); +INSERT INTO `countries` (country,code) VALUES ('NORWAY','NO'); +INSERT INTO `countries` (country,code) VALUES ('OMAN','OM'); +INSERT INTO `countries` (country,code) VALUES ('PAKISTAN','PK'); +INSERT INTO `countries` (country,code) VALUES ('PALAU','PW'); +INSERT INTO `countries` (country,code) VALUES ('PALESTINIAN TERRITORY, OCCUPIED','PS'); +INSERT INTO `countries` (country,code) VALUES ('PANAMA','PA'); +INSERT INTO `countries` (country,code) VALUES ('PAPUA NEW GUINEA','PG'); +INSERT INTO `countries` (country,code) VALUES ('PARAGUAY','PY'); +INSERT INTO `countries` (country,code) VALUES ('PERU','PE'); +INSERT INTO `countries` (country,code) VALUES ('PHILIPPINES','PH'); +INSERT INTO `countries` (country,code) VALUES ('PITCAIRN','PN'); +INSERT INTO `countries` (country,code) VALUES ('POLAND','PL'); +INSERT INTO `countries` (country,code) VALUES ('PORTUGAL','PT'); +INSERT INTO `countries` (country,code) VALUES ('PUERTO RICO','PR'); +INSERT INTO `countries` (country,code) VALUES ('QATAR','QA'); +INSERT INTO `countries` (country,code) VALUES ('REUNION','RE'); +INSERT INTO `countries` (country,code) VALUES ('ROMANIA','RO'); +INSERT INTO `countries` (country,code) VALUES ('RUSSIAN FEDERATION','RU'); +INSERT INTO `countries` (country,code) VALUES ('RWANDA','RW'); +INSERT INTO `countries` (country,code) VALUES ('SAINT BARTHÉLEMY','BL'); +INSERT INTO `countries` (country,code) VALUES ('SAINT HELENA','SH'); +INSERT INTO `countries` (country,code) VALUES ('SAINT KITTS AND NEVIS','KN'); +INSERT INTO `countries` (country,code) VALUES ('SAINT LUCIA','LC'); +INSERT INTO `countries` (country,code) VALUES ('SAINT MARTIN','MF'); +INSERT INTO `countries` (country,code) VALUES ('SAINT PIERRE AND MIQUELON','PM'); +INSERT INTO `countries` (country,code) VALUES ('SAINT VINCENT AND THE GRENADINES','VC'); +INSERT INTO `countries` (country,code) VALUES ('SAMOA','WS'); +INSERT INTO `countries` (country,code) VALUES ('SAN MARINO','SM'); +INSERT INTO `countries` (country,code) VALUES ('SAO TOME AND PRINCIPE','ST'); +INSERT INTO `countries` (country,code) VALUES ('SAUDI ARABIA','SA'); +INSERT INTO `countries` (country,code) VALUES ('SENEGAL','SN'); +INSERT INTO `countries` (country,code) VALUES ('SERBIA','RS'); +INSERT INTO `countries` (country,code) VALUES ('SEYCHELLES','SC'); +INSERT INTO `countries` (country,code) VALUES ('SIERRA LEONE','SL'); +INSERT INTO `countries` (country,code) VALUES ('SINGAPORE','SG'); +INSERT INTO `countries` (country,code) VALUES ('SLOVAKIA','SK'); +INSERT INTO `countries` (country,code) VALUES ('SLOVENIA','SI'); +INSERT INTO `countries` (country,code) VALUES ('SOLOMON ISLANDS','SB'); +INSERT INTO `countries` (country,code) VALUES ('SOMALIA','SO'); +INSERT INTO `countries` (country,code) VALUES ('SOUTH AFRICA','ZA'); +INSERT INTO `countries` (country,code) VALUES ('SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS','GS'); +INSERT INTO `countries` (country,code) VALUES ('SPAIN','ES'); +INSERT INTO `countries` (country,code) VALUES ('SRI LANKA','LK'); +INSERT INTO `countries` (country,code) VALUES ('SUDAN','SD'); +INSERT INTO `countries` (country,code) VALUES ('SURINAME','SR'); +INSERT INTO `countries` (country,code) VALUES ('SVALBARD AND JAN MAYEN','SJ'); +INSERT INTO `countries` (country,code) VALUES ('SWAZILAND','SZ'); +INSERT INTO `countries` (country,code) VALUES ('SWEDEN','SE'); +INSERT INTO `countries` (country,code) VALUES ('SWITZERLAND','CH'); +INSERT INTO `countries` (country,code) VALUES ('SYRIAN ARAB REPUBLIC','SY'); +INSERT INTO `countries` (country,code) VALUES ('TAIWAN, PROVINCE OF CHINA','TW'); +INSERT INTO `countries` (country,code) VALUES ('TAJIKISTAN','TJ'); +INSERT INTO `countries` (country,code) VALUES ('TANZANIA, UNITED REPUBLIC OF','TZ'); +INSERT INTO `countries` (country,code) VALUES ('THAILAND','TH'); +INSERT INTO `countries` (country,code) VALUES ('TIMOR-LESTE','TL'); +INSERT INTO `countries` (country,code) VALUES ('TOGO','TG'); +INSERT INTO `countries` (country,code) VALUES ('TOKELAU','TK'); +INSERT INTO `countries` (country,code) VALUES ('TONGA','TO'); +INSERT INTO `countries` (country,code) VALUES ('TRINIDAD AND TOBAGO','TT'); +INSERT INTO `countries` (country,code) VALUES ('TUNISIA','TN'); +INSERT INTO `countries` (country,code) VALUES ('TURKEY','TR'); +INSERT INTO `countries` (country,code) VALUES ('TURKMENISTAN','TM'); +INSERT INTO `countries` (country,code) VALUES ('TURKS AND CAICOS ISLANDS','TC'); +INSERT INTO `countries` (country,code) VALUES ('TUVALU','TV'); +INSERT INTO `countries` (country,code) VALUES ('UGANDA','UG'); +INSERT INTO `countries` (country,code) VALUES ('UKRAINE','UA'); +INSERT INTO `countries` (country,code) VALUES ('UNITED ARAB EMIRATES','AE'); +INSERT INTO `countries` (country,code) VALUES ('UNITED KINGDOM','GB'); +INSERT INTO `countries` (country,code) VALUES ('UNITED STATES','US'); +INSERT INTO `countries` (country,code) VALUES ('UNITED STATES MINOR OUTLYING ISLANDS','UM'); +INSERT INTO `countries` (country,code) VALUES ('URUGUAY','UY'); +INSERT INTO `countries` (country,code) VALUES ('UZBEKISTAN','UZ'); +INSERT INTO `countries` (country,code) VALUES ('VANUATU','VU'); +INSERT INTO `countries` (country,code) VALUES ('VENEZUELA','VE'); +INSERT INTO `countries` (country,code) VALUES ('VIET NAM','VN'); +INSERT INTO `countries` (country,code) VALUES ('VIRGIN ISLANDS, BRITISH','VG'); +INSERT INTO `countries` (country,code) VALUES ('VIRGIN ISLANDS, U.S.','VI'); +INSERT INTO `countries` (country,code) VALUES ('WALLIS AND FUTUNA','WF'); +INSERT INTO `countries` (country,code) VALUES ('WESTERN SAHARA','EH'); +INSERT INTO `countries` (country,code) VALUES ('YEMEN','YE'); +INSERT INTO `countries` (country,code) VALUES ('ZAMBIA','ZM'); +INSERT INTO `countries` (country,code) VALUES ('ZIMBABWE','ZW'); +ALTER TABLE `provinces` DROP INDEX `code`; +ALTER TABLE `provinces` ADD `countries_code` VARCHAR( 2 ) NOT NULL ; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='ON' AND `province`='Ontario'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='NF' AND `province`='Newfoundland and Labrador'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='PE' AND `province`='Prince Edward Island'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='NS' AND `province`='Nova Scotia'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='NB' AND `province`='New Brunswick'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='QC' AND `province`='Quebec'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='MB' AND `province`='Manitoba'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='SK' AND `province`='Saskatchewan'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='AB' AND `province`='Alberta'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='BC' AND `province`='British Columbia'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='YK' AND `province`='Yukon Territory'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='NT' AND `province`='Northwest Territories'; +UPDATE `provinces` SET `countries_code` = 'CA' WHERE `code`='NU' AND `province`='Nunavut'; +ALTER TABLE `provinces` ADD UNIQUE (`countries_code`,`code`); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Alabama','AL','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Alaska','AK','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('American Samoa','AS','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Arizona','AZ','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Arkansas','AR','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('California','CA','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Colorado','CO','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Connecticut','CT','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Delaware','DE','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('District of Columbia','DC','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Federated States of Micronesia','FM','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Florida','FL','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Georgia','GA','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Guam','GU','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Hawaii','HI','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Idaho','ID','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Illinois','IL','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Indiana','IN','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Iowa','IA','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Kansas','KS','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Kentucky','KY','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Louisiana','LA','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Maine','ME','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Marshall Islands','MH','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Maryland','MD','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Massachusetts','MA','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Michigan','MI','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Minnesota','MN','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Mississippi','MS','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Missouri','MO','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Montana','MT','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Nebraska','NE','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Nevada','NV','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('New Hampshire','NH','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('New Jersey','NJ','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('New Mexico','NM','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('New York','NY','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('North Carolina','NC','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('North Dakota','ND','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Northern Mariana Islands','MP','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Ohio','OH','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Oklahoma','OK','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Oregon','OR','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Palau','PW','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Pennsylvania','PA','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Puerto Rico','PR','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Rhode Island','RI','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('South Carolina','SC','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('South Dakota','SD','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Tennessee','TN','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Texas','TX','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Utah','UT','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Vermont','VT','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Virgin Islands','VI','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Virginia','VA','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Washington','WA','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('West Virginia','WV','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Wisconsin','WI','US'); +INSERT INTO `provinces` (province,code,countries_code) VALUES ('Wyoming','WY','US'); +INSERT INTO `config` ( `var` , `val` , `category` , `type` , `type_values` , `ord` , `description` , `year`) VALUES ( +'country', 'CA', 'Localization', 'text', '', '90', 'Country code (look up 2 letter code)', '-1'); +