PHP Classes
elePHPant
Icontem

File: install_tbl_country.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Oliver Susano  >  queryList  >  install_tbl_country.php  >  Download  
File: install_tbl_country.php
Role: Example script
Content type: text/plain
Description: generate tbl_country on your database with countries
Class: queryList
query with pagination and previous next
Author: By
Last change:
Date: 11 years ago
Size: 7,611 bytes
 

Contents

Class file image Download
<?php

   
include ("dbConnect.php");

$country = array(
   
        
"ad" => "Andorra",
        
"ae" => "United Arab Emirates",
        
"af" => "Afghanistan",
        
"ag" => "Antigua and Barbuda",
        
"ai" => "Anguilla",
        
"al" => "Albania",
        
"am" => "Armenia",
        
"an" => "Netherlands Antilles",
        
"ao" => "Angola",
        
"aq" => "Antartica",
        
"ar" => "Argentina",
        
"as" => "American Samoa",
        
"at" => "Austria",
        
"au" => "Australia",
        
"aw" => "Aruba",
        
"az" => "Azerbaijan",
        
        
"ba" => "Bosnia and Herzegovina",
        
"bb" => "Barbados",
        
"bd" => "Bangladesh",
        
"be" => "Belgium",
        
"bf" => "Burkina Faso",
        
"bg" => "Bulgaria",
        
"bh" => "Bahrain",
        
"bi" => "Burundi",
        
"bj" => "Benin",
        
"bm" => "Bermuda",
        
"bn" => "Brunei Darussalam",
        
"bo" => "Bolivia",
        
"br" => "Brazil",
        
"bs" => "Bahamas",
        
"bt" => "Bhutan",
        
"bv" => "Bouvet Island",
        
"bw" => "Botswana",
        
"by" => "Belorussia",
        
"bz" => "Belize",
        
        
"ca" => "Canada",
        
"cc" => "Cocos (Keeling) Islands",
        
"cd" => "Democatric Republic of Congo",
        
"cf" => "Central African Republic",
        
"cg" => "Congo",
        
"ch" => "Switzerland",
        
"ci" => "Cote D'Ivoire (Ivory Coast)",
        
"ck" => "Cook Islands",
        
"cl" => "Chile",
        
"cm" => "Cameroon",
        
"cn" => "China",
        
"co" => "Colombia",
        
"cr" => "Costa Rica",
        
"cs" => "Czechoslovakia",
        
"cu" => "Cuba",
        
"cv" => "Cape Verde",
        
"cx" => "Christmas Island",
        
"cy" => "Cyprus",
        
"cz" => "Czech",
        
        
"de" => "Germany",
        
"dj" => "Djibouti",
        
"dk" => "Denmark",
        
"dm" => "Dominica",
        
"do" => "Dominican Republic",
        
"dz" => "Algeria",
        
        
"ec" => "Ecuador",
        
"ee" => "Estonia",
        
"eg" => "Egypt",
        
"eh" => "Western Sahara",
        
"er" => "Eritrea",
        
"es" => "Spain",
        
"et" => "Ethiopia",

        
"fi" => "Finland",
        
"fj" => "Fiji",
        
"fk" => "Falkland Islands (Malvinas)",
        
"fm" => "Micronesia",
        
"fo" => "Faroe Islands",
        
"fr" => "France",
        
"fx" => "France, Metropolitan",
        
        
"ga" => "Gabon",
        
"gb" => "Great Britain",
        
"gd" => "Grenada",
        
"ge" => "Georgia",
        
"gf" => "French Guiana",
        
"gh" => "Ghana",
        
"gi" => "Gibraltar",
        
"gl" => "Greenland",
        
"gm" => "Gambia",
        
"gn" => "Guinea",
        
"gp" => "Guadelope",
        
"gq" => "Equatorial Guinea",
        
"gr" => "Greece",
        
"gs" => "S.Georgia and S.Sandwich Isls.",
        
"gt" => "Guatemala",
        
"gu" => "Guam",
        
"gw" => "Guinea Bissau",
        
"gy" => "Gyana",
        
        
"hk" => "Hong Kong",
        
"hm" => "Heard and McDonald Islands",
        
"hn" => "Honduras",
        
"hr" => "Croatia",
        
"ht" => "Haiti",
        
"hu" => "Hungary",

        
"id" => "Indonesia",
        
"ie" => "Ireland",
        
"il" => "Israel",
        
"in" => "India",
        
"io" => "British Idian Ocean Territory",
        
"iq" => "Iraq",
        
"ir" => "Iran",
        
"is" => "Iceland",
        
"it" => "Italy",

        
"jm" => "Jamaica",
        
"jo" => "Jordan",
        
"jp" => "Japan",

        
"ke" => "Kenya",
        
"kg" => "Kyrgyzstan",
        
"kh" => "Cambodia",
        
"ki" => "Kiribati",
        
"km" => "Comoros",
        
"kn" => "Saint Kitts and Nevis",
        
"kp" => "North Korea",
        
"kr" => "South Korea",
        
"kw" => "Kuwait",
        
"ky" => "Cayman Islands",
        
"kz" => "Kazakhstan",
        
        
"la" => "Laos",
        
"lb" => "Lebanon",
        
"lc" => "Saint Lucia",
        
"li" => "Liechtenstein",
        
"lk" => "Sri Lanka",
        
"lr" => "Liberia",
        
"ls" => "Lesotho",
        
"lt" => "Lithuania",
        
"lu" => "Luxembourg",
        
"lv" => "Latvia",
        
"ly" => "Lybia",
        
        
"ma" => "Marocco",
        
"mc" => "Monaco",
        
"md" => "Moldova",
        
"mg" => "Madagascar", # need
        
"mh" => "Marshall Islands", # need
        
"mk" => "Macedonia",
        
"ml" => "Mali", # need
        
"mm" => "Myanmar", # need
        
"mn" => "Mongolia", # need
        
"mo" => "Macau", # need
        
"mp" => "Northern Mariana Islands", # need
        
"mq" => "Martinique",
        
"mr" => "Mauritania",
        
"ms" => "Montserrat", # need
        
"mt" => "Malta",
        
"mu" => "Mauritius",
        
"mv" => "Maldives", # need
        
"mw" => "Malawi", # need
        
"mx" => "Mexico",
        
"my" => "Malaysia",
        
"mz" => "Mozambique", # need

        
"na" => "Namibia",
        
"nc" => "New Caledonia", # need
        
"ne" => "Niger",
        
"nf" => "Norfolk Island", # need
        
"ng" => "Nigeria",
        
"ni" => "Nicaragua",
        
"nl" => "Netherlands",
        
"no" => "Norway",
        
"np" => "Nepal",
        
"nr" => "Nauru", # need
        
"nt" => "Neutral Zone", # need
        
"nu" => "Niue",
        
"nz" => "New Zealand",
        
        
"om" => "Oman",

        
"pa" => "Panama",
        
"pe" => "Peru",
        
"pf" => "French Polynesia",
        
"pg" => "Papua New Guinea", # need
        
"ph" => "Philippines",
        
"pk" => "Pakistan",
        
"pl" => "Poland",
        
"pm" => "St. Pierre and Miquelon", # need
        
"pn" => "Pitcairn", # need
        
"pr" => "Puerto Rico", # need
        
"pt" => "Portugal",
        
"pw" => "Palau", # need
        
"py" => "Paraguay",

        
"qa" => "Qatar",

        
"re" => "Reunion", # need
        
"ro" => "Romania",
        
"ru" => "Russian Federation",
        
"rw" => "Rwanda",

        
"sa" => "Saudi Arabia",
        
"sb" => "Solomon Islands",
        
"sc" => "Seychelles", # need
        
"sd" => "Sudan", # need
        
"se" => "Sweden",
        
"sg" => "Singapore",
        
"sh" => "St. Helena", # need
        
"si" => "Slovania",
        
"sj" => "Svalbard and Jan Mayen Islands", # need
        
"sk" => "Slovak Republic",
        
"sl" => "Sierra Leone", # need
        
"sm" => "San Marino", # need
        
"sn" => "Senegal", # need
        
"so" => "Somalia", # need
        
"sr" => "Suriname", # need
        
"st" => "Sao Tome and Principe", # need
        
"su" => "Soviet Union",
        
"sv" => "El Salvador", # need
        
"sy" => "Syria",
        
"sz" => "Swaziland",

        
"tc" => "Turks and Caicos Islands",
        
"td" => "Chad",
        
"tf" => "French Southern Territories",
        
"tg" => "Togo",
        
"th" => "Thailand",
        
"tj" => "Tajikistan", # need
        
"tk" => "Tokelau",
        
"tm" => "Turkmenistan",
        
"tn" => "Tunisia",
        
"to" => "Tonga",
        
"tp" => "East Timor", # need
        
"tr" => "Turkey",
        
"tt" => "Trinidad and Tobago",
        
"tv" => "Tuvalu", # need
        
"tw" => "Taiwan",
        
"tz" => "Tanzania",

        
"ua" => "Ukraine",
        
"ug" => "Uganda",
        
"uk" => "United Kingdom",
        
"um" => "US Minor Outlying Islands",
        
"us" => "United States",
        
"uy" => "Uruguay",
        
"uz" => "Uzbekistan",

        
"va" => "Vatican City State (Holy See)",
        
"vc" => "Saint Vincent and the Grenadines",
        
"ve" => "Venezuela",
        
"vg" => "Virgin Islands (British)",
        
"vi" => "Virgin Islands (US)",
        
"vn" => "Vietnam",

        
"wf" => "Wallis and Futuna Islands",
        
"ws" => "Samoa",

        
"ye" => "Yemen",
        
"yt" => "Mayotte",
        
"yu" => "Yugoslavia",

        
"za" => "South Africa",
        
"ze" => "Zaire",
        
"zm" => "Zambia",
        
"zw" => "Zimbabwe"
        
);


/* ----------------------------------------------------------- */




mysql_query("DROP TABLE IF EXISTS tbl_country");

mysql_query("CREATE TABLE tbl_country ( code char(2) NOT NULL default '', country varchar(32)
NOT NULL default '', UNIQUE KEY code (code)) TYPE=MyISAM COMMENT='Table des Pays' "
);

foreach(
$country as $k => $v) {
   
mysql_query("INSERT INTO `tbl_country` (`code` ,`country` ) VALUES ('$k','$v') ");
}


?>Installation finished!