raramuridesign / mysql-country-list Goto Github PK
View Code? Open in Web Editor NEWmysql insert country list into database
Home Page: https://kb.raramuridesign.com/mysql-country-and-nationality-list-imports.html
License: MIT License
mysql insert country list into database
Home Page: https://kb.raramuridesign.com/mysql-country-and-nationality-list-imports.html
License: MIT License
Antigua and/or Barbuda
The correct name is
Antigua and Barbuda
PS: Possibly I'm wrong, but I've never seen and/or before and ca't find any source where it is present.
Are these 2d coordinates of some sort?
Hey man, consider deleting Yugoslavia from db. It doesn't exists anymore.
Sorry if this is confusing, it's my first time to use github.
-Sinisa
<?php
$arr = array(
'AF' => 'Afghanistan',
'AL' => 'Albania',
'DZ' => 'Algeria',
'DS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antarctica',
'AG' => 'Antigua and Barbuda',
'AR' => 'Argentina',
'AM' => 'Armenia',
'AW' => 'Aruba',
'AU' => 'Australia',
'AT' => 'Austria',
'AZ' => 'Azerbaijan',
'BS' => 'Bahamas',
'BH' => 'Bahrain',
'BD' => 'Bangladesh',
'BB' => 'Barbados',
'BY' => 'Belarus',
'BE' => 'Belgium',
'BZ' => 'Belize',
'BJ' => 'Benin',
'BM' => 'Bermuda',
'BT' => 'Bhutan',
'BO' => 'Bolivia',
'BA' => 'Bosnia and Herzegovina',
'BW' => 'Botswana',
'BV' => 'Bouvet Island',
'BR' => 'Brazil',
'IO' => 'British Indian Ocean Territory',
'BN' => 'Brunei Darussalam',
'BG' => 'Bulgaria',
'BF' => 'Burkina Faso',
'BI' => 'Burundi',
'KH' => 'Cambodia',
'CM' => 'Cameroon',
'CA' => 'Canada',
'CV' => 'Cape Verde',
'KY' => 'Cayman Islands',
'CF' => 'Central African Republic',
'TD' => 'Chad',
'CL' => 'Chile',
'CN' => 'China',
'CX' => 'Christmas Island',
'CC' => 'Cocos (Keeling) Islands',
'CO' => 'Colombia',
'KM' => 'Comoros',
'CG' => 'Congo',
'CK' => 'Cook Islands',
'CR' => 'Costa Rica',
'HR' => 'Croatia (Hrvatska)',
'CU' => 'Cuba',
'CY' => 'Cyprus',
'CZ' => 'Czech Republic',
'DK' => 'Denmark',
'DJ' => 'Djibouti',
'DM' => 'Dominica',
'DO' => 'Dominican Republic',
'TP' => 'East Timor',
'EC' => 'Ecuador',
'EG' => 'Egypt',
'SV' => 'El Salvador',
'GQ' => 'Equatorial Guinea',
'ER' => 'Eritrea',
'EE' => 'Estonia',
'ET' => 'Ethiopia',
'FK' => 'Falkland Islands (Malvinas)',
'FO' => 'Faroe Islands',
'FJ' => 'Fiji',
'FI' => 'Finland',
'FR' => 'France',
'FX' => 'France, Metropolitan',
'GF' => 'French Guiana',
'PF' => 'French Polynesia',
'TF' => 'French Southern Territories',
'GA' => 'Gabon',
'GM' => 'Gambia',
'GE' => 'Georgia',
'DE' => 'Germany',
'GH' => 'Ghana',
'GI' => 'Gibraltar',
'GK' => 'Guernsey',
'GR' => 'Greece',
'GL' => 'Greenland',
'GD' => 'Grenada',
'GP' => 'Guadeloupe',
'GU' => 'Guam',
'GT' => 'Guatemala',
'GN' => 'Guinea',
'GW' => 'Guinea-Bissau',
'GY' => 'Guyana',
'HT' => 'Haiti',
'HM' => 'Heard and Mc Donald Islands',
'HN' => 'Honduras',
'HK' => 'Hong Kong',
'HU' => 'Hungary',
'IS' => 'Iceland',
'IN' => 'India',
'IM' => 'Isle of Man',
'ID' => 'Indonesia',
'IR' => 'Iran (Islamic Republic of)',
'IQ' => 'Iraq',
'IE' => 'Ireland',
'IL' => 'Israel',
'IT' => 'Italy',
'CI' => 'Ivory Coast',
'JE' => 'Jersey',
'JM' => 'Jamaica',
'JP' => 'Japan',
'JO' => 'Jordan',
'KZ' => 'Kazakhstan',
'KE' => 'Kenya',
'KI' => 'Kiribati',
'KP' => 'Korea, Democratic People''s Republic of',
'KR' => 'Korea, Republic of',
'XK' => 'Kosovo',
'KW' => 'Kuwait',
'KG' => 'Kyrgyzstan',
'LA' => 'Lao People''s Democratic Republic',
'LV' => 'Latvia',
'LB' => 'Lebanon',
'LS' => 'Lesotho',
'LR' => 'Liberia',
'LY' => 'Libyan Arab Jamahiriya',
'LI' => 'Liechtenstein',
'LT' => 'Lithuania',
'LU' => 'Luxembourg',
'MO' => 'Macau',
'MK' => 'Macedonia',
'MG' => 'Madagascar',
'MW' => 'Malawi',
'MY' => 'Malaysia',
'MV' => 'Maldives',
'ML' => 'Mali',
'MT' => 'Malta',
'MH' => 'Marshall Islands',
'MQ' => 'Martinique',
'MR' => 'Mauritania',
'MU' => 'Mauritius',
'TY' => 'Mayotte',
'MX' => 'Mexico',
'FM' => 'Micronesia, Federated States of',
'MD' => 'Moldova, Republic of',
'MC' => 'Monaco',
'MN' => 'Mongolia',
'ME' => 'Montenegro',
'MS' => 'Montserrat',
'MA' => 'Morocco',
'MZ' => 'Mozambique',
'MM' => 'Myanmar',
'NA' => 'Namibia',
'NR' => 'Nauru',
'NP' => 'Nepal',
'NL' => 'Netherlands',
'AN' => 'Netherlands Antilles',
'NC' => 'New Caledonia',
'NZ' => 'New Zealand',
'NI' => 'Nicaragua',
'NE' => 'Niger',
'NG' => 'Nigeria',
'NU' => 'Niue',
'NF' => 'Norfolk Island',
'MP' => 'Northern Mariana Islands',
'NO' => 'Norway',
'OM' => 'Oman',
'PK' => 'Pakistan',
'PW' => 'Palau',
'PS' => 'Palestine',
'PA' => 'Panama',
'PG' => 'Papua New Guinea',
'PY' => 'Paraguay',
'PE' => 'Peru',
'PH' => 'Philippines',
'PN' => 'Pitcairn',
'PL' => 'Poland',
'PT' => 'Portugal',
'PR' => 'Puerto Rico',
'QA' => 'Qatar',
'RE' => 'Reunion',
'RO' => 'Romania',
'RU' => 'Russian Federation',
'RW' => 'Rwanda',
'KN' => 'Saint Kitts and Nevis',
'LC' => 'Saint Lucia',
'VC' => 'Saint Vincent and the Grenadines',
'WS' => 'Samoa',
'SM' => 'San Marino',
'ST' => 'Sao Tome and Principe',
'SA' => 'Saudi Arabia',
'SN' => 'Senegal',
'RS' => 'Serbia',
'SC' => 'Seychelles',
'SL' => 'Sierra Leone',
'SG' => 'Singapore',
'SK' => 'Slovakia',
'SI' => 'Slovenia',
'SB' => 'Solomon Islands',
'SO' => 'Somalia',
'ZA' => 'South Africa',
'GS' => 'South Georgia South Sandwich Islands',
'ES' => 'Spain',
'LK' => 'Sri Lanka',
'SH' => 'St. Helena',
'PM' => 'St. Pierre and Miquelon',
'SD' => 'Sudan',
'SR' => 'Suriname',
'SJ' => 'Svalbard and Jan Mayen Islands',
'SZ' => 'Swaziland',
'SE' => 'Sweden',
'CH' => 'Switzerland',
'SY' => 'Syrian Arab Republic',
'TW' => 'Taiwan',
'TJ' => 'Tajikistan',
'TZ' => 'Tanzania, United Republic of',
'TH' => 'Thailand',
'TG' => 'Togo',
'TK' => 'Tokelau',
'TO' => 'Tonga',
'TT' => 'Trinidad and Tobago',
'TN' => 'Tunisia',
'TR' => 'Turkey',
'TM' => 'Turkmenistan',
'TC' => 'Turks and Caicos Islands',
'TV' => 'Tuvalu',
'UG' => 'Uganda',
'UA' => 'Ukraine',
'AE' => 'United Arab Emirates',
'GB' => 'United Kingdom',
'US' => 'United States',
'UM' => 'United States minor outlying islands',
'UY' => 'Uruguay',
'UZ' => 'Uzbekistan',
'VU' => 'Vanuatu',
'VA' => 'Vatican City State',
'VE' => 'Venezuela',
'VN' => 'Vietnam',
'VG' => 'Virgin Islands (British)',
'VI' => 'Virgin Islands (U.S.)',
'WF' => 'Wallis and Futuna Islands',
'EH' => 'Western Sahara',
'YE' => 'Yemen',
'ZR' => 'Zaire',
'ZM' => 'Zambia',
'ZW' => 'Zimbabwe'
);
While you are at it and made a great job, why have a separate table just for Phone Country Code?
Add that and your Country List is very complete and totally useful.
:-)
Hi there,
Just wanted to let you know that the country flags for the Congo (cg) and the Democratic Republic of Congo (cd) have been inverted for the 16x16 and 24x24, pictures.
Zaire is a deprecated name of the country. It's now known as DRC - Democratic Republic of Congo
Hi.
Consider adding LICENSE file to your repository. :)
I would like to add your file to my open-source project, but now I dont even know if I may, and on what conditions. 👍
Thanks !
As this is the 1st result from google, I think it'd be appropriate for it to be in alphabetical order. While it can be made afterwards with a mysql query, it'd be simpler if it was in alphabetical order by default. Right now it's alphabetical except United States and Canada (I guess home town of developers) that are the 1st and 2nd.
Is:
INSERT INTO countries
VALUES (33, 'IO', 'British lndian Ocean Territory');
Should be:
INSERT INTO countries
VALUES (33, 'IO', 'British Indian Ocean Territory');
(was lower case L for first letter of Indian, I replaced it with upper case i)
countryName
varchar(45) NOT NULL DEFAULT '',
it must be 64 for this
'United Kingdom of Great Britain and Northern Ireland'
Hello,
Can you please add country code of phone number in details database.
Thanks
I suggest to change:
INSERT INTO `apps_countries` VALUES ('', 'AF', 'Afghanistan');
with
INSERT INTO `apps_countries` VALUES (null, 'AF', 'Afghanistan');
It fixes the issu.
Hi,
I've discovered 3 duplicates that throw the order out.
ID 114, 143, and 186 are repeated. Took me a while to manual fix before I could run the insert successfully via PHPMyAdmin :)
Can you please provide any query for Cities List for Countries?
The Netherlands Antilles were dissolved back in 2010 and yet it is still in this list and not as separate countries. ( Sint Maarten ( SX ) & Curaçao (CW) )
I noticed however that this list isn't even totally in sync with ISO-3661-1, part of the ISO-3661 standard. So it could be this list isn't based on the ISO-3661 standard in which case it makes sense
that for example Sint Maarten and Curaçao are still listed under their former country names (The) Netherlands Antilles.
But if the list is meant to be based on ISO-3661-1 then there's a full list available at the official site of ISO
(https://www.iso.org/obp/ui/#search)
This is the list as I managed to parse of the official ISO site containing all the 249 countries:
countries.json.txt
EN: Country name in English (short)
Local: Country name in French (short)
Code: 2 character code representing the country
I am 99% percent sure the list is correct but I would suggest to check it if you plan to use it.
I know a lot of country forms online use the same list as used in this project however it isn't exactly political correct and my question is, is political correctness part of the intentions of this project?
If you are using Django, import this.
from django.utils.translation import gettext_lazy as _
TYPES_SELECT_COUNTRY = (
('AF', _('Afghanistan')),
('AL', _('Albania')),
('DZ', _('Algeria')),
('DS', _('American Samoa')),
('AD', _('Andorra')),
('AO', _('Angola')),
('AI', _('Anguilla')),
('AQ', _('Antarctica')),
('AG', _('Antigua and Barbuda')),
('AR', _('Argentina')),
('AM', _('Armenia')),
('AW', _('Aruba')),
('AU', _('Australia')),
('AT', _('Austria')),
('AZ', _('Azerbaijan')),
('BS', _('Bahamas')),
('BH', _('Bahrain')),
('BD', _('Bangladesh')),
('BB', _('Barbados')),
('BY', _('Belarus')),
('BE', _('Belgium')),
('BZ', _('Belize')),
('BJ', _('Benin')),
('BM', _('Bermuda')),
('BT', _('Bhutan')),
('BO', _('Bolivia')),
('BA', _('Bosnia and Herzegovina')),
('BW', _('Botswana')),
('BV', _('Bouvet Island')),
('BR', _('Brazil')),
('IO', _('British Indian Ocean Territory')),
('BN', _('Brunei Darussalam')),
('BG', _('Bulgaria')),
('BF', _('Burkina Faso')),
('BI', _('Burundi')),
('KH', _('Cambodia')),
('CM', _('Cameroon')),
('CA', _('Canada')),
('CV', _('Cape Verde')),
('KY', _('Cayman Islands')),
('CF', _('Central African Republic')),
('TD', _('Chad')),
('CL', _('Chile')),
('CN', _('China')),
('CX', _('Christmas Island')),
('CC', _('Cocos (Keeling) Islands')),
('CO', _('Colombia')),
('KM', _('Comoros')),
('CG', _('Congo')),
('CK', _('Cook Islands')),
('CR', _('Costa Rica')),
('HR', _('Croatia (Hrvatska)')),
('CU', _('Cuba')),
('CY', _('Cyprus')),
('CZ', _('Czech Republic')),
('DK', _('Denmark')),
('DJ', _('Djibouti')),
('DM', _('Dominica')),
('DO', _('Dominican Republic')),
('TP', _('East Timor')),
('EC', _('Ecuador')),
('EG', _('Egypt')),
('SV', _('El Salvador')),
('GQ', _('Equatorial Guinea')),
('ER', _('Eritrea')),
('EE', _('Estonia')),
('ET', _('Ethiopia')),
('FK', _('Falkland Islands (Malvinas)')),
('FO', _('Faroe Islands')),
('FJ', _('Fiji')),
('FI', _('Finland')),
('FR', _('France')),
('FX', _('France, Metropolitan')),
('GF', _('French Guiana')),
('PF', _('French Polynesia')),
('TF', _('French Southern Territories')),
('GA', _('Gabon')),
('GM', _('Gambia')),
('GE', _('Georgia')),
('DE', _('Germany')),
('GH', _('Ghana')),
('GI', _('Gibraltar')),
('GK', _('Guernsey')),
('GR', _('Greece')),
('GL', _('Greenland')),
('GD', _('Grenada')),
('GP', _('Guadeloupe')),
('GU', _('Guam')),
('GT', _('Guatemala')),
('GN', _('Guinea')),
('GW', _('Guinea-Bissau')),
('GY', _('Guyana')),
('HT', _('Haiti')),
('HM', _('Heard and Mc Donald Islands')),
('HN', _('Honduras')),
('HK', _('Hong Kong')),
('HU', _('Hungary')),
('IS', _('Iceland')),
('IN', _('India')),
('IM', _('Isle of Man')),
('ID', _('Indonesia')),
('IR', _('Iran (Islamic Republic of)')),
('IQ', _('Iraq')),
('IE', _('Ireland')),
('IL', _('Israel')),
('IT', _('Italy')),
('CI', _('Ivory Coast')),
('JE', _('Jersey')),
('JM', _('Jamaica')),
('JP', _('Japan')),
('JO', _('Jordan')),
('KZ', _('Kazakhstan')),
('KE', _('Kenya')),
('KI', _('Kiribati')),
('KP', _('Korea, Democratic People\'s Republic of')),
('KR', _('Korea, Republic of')),
('XK', _('Kosovo')),
('KW', _('Kuwait')),
('KG', _('Kyrgyzstan')),
('LA', _('Lao People\'s Democratic Republic')),
('LV', _('Latvia')),
('LB', _('Lebanon')),
('LS', _('Lesotho')),
('LR', _('Liberia')),
('LY', _('Libyan Arab Jamahiriya')),
('LI', _('Liechtenstein')),
('LT', _('Lithuania')),
('LU', _('Luxembourg')),
('MO', _('Macau')),
('MK', _('Macedonia')),
('MG', _('Madagascar')),
('MW', _('Malawi')),
('MY', _('Malaysia')),
('MV', _('Maldives')),
('ML', _('Mali')),
('MT', _('Malta')),
('MH', _('Marshall Islands')),
('MQ', _('Martinique')),
('MR', _('Mauritania')),
('MU', _('Mauritius')),
('TY', _('Mayotte')),
('MX', _('Mexico')),
('FM', _('Micronesia, Federated States of')),
('MD', _('Moldova, Republic of')),
('MC', _('Monaco')),
('MN', _('Mongolia')),
('ME', _('Montenegro')),
('MS', _('Montserrat')),
('MA', _('Morocco')),
('MZ', _('Mozambique')),
('MM', _('Myanmar')),
('NA', _('Namibia')),
('NR', _('Nauru')),
('NP', _('Nepal')),
('NL', _('Netherlands')),
('AN', _('Netherlands Antilles')),
('NC', _('New Caledonia')),
('NZ', _('New Zealand')),
('NI', _('Nicaragua')),
('NE', _('Niger')),
('NG', _('Nigeria')),
('NU', _('Niue')),
('NF', _('Norfolk Island')),
('MP', _('Northern Mariana Islands')),
('NO', _('Norway')),
('OM', _('Oman')),
('PK', _('Pakistan')),
('PW', _('Palau')),
('PS', _('Palestine')),
('PA', _('Panama')),
('PG', _('Papua New Guinea')),
('PY', _('Paraguay')),
('PE', _('Peru')),
('PH', _('Philippines')),
('PN', _('Pitcairn')),
('PL', _('Poland')),
('PT', _('Portugal')),
('PR', _('Puerto Rico')),
('QA', _('Qatar')),
('RE', _('Reunion')),
('RO', _('Romania')),
('RU', _('Russian Federation')),
('RW', _('Rwanda')),
('KN', _('Saint Kitts and Nevis')),
('LC', _('Saint Lucia')),
('VC', _('Saint Vincent and the Grenadines')),
('WS', _('Samoa')),
('SM', _('San Marino')),
('ST', _('Sao Tome and Principe')),
('SA', _('Saudi Arabia')),
('SN', _('Senegal')),
('RS', _('Serbia')),
('SC', _('Seychelles')),
('SL', _('Sierra Leone')),
('SG', _('Singapore')),
('SK', _('Slovakia')),
('SI', _('Slovenia')),
('SB', _('Solomon Islands')),
('SO', _('Somalia')),
('ZA', _('South Africa')),
('SS', _('South Sudan')),
('GS', _('South Georgia South Sandwich Islands')),
('ES', _('Spain')),
('LK', _('Sri Lanka')),
('SH', _('St. Helena')),
('PM', _('St. Pierre and Miquelon')),
('SD', _('Sudan')),
('SR', _('Suriname')),
('SJ', _('Svalbard and Jan Mayen Islands')),
('SZ', _('Swaziland')),
('SE', _('Sweden')),
('CH', _('Switzerland')),
('SY', _('Syrian Arab Republic')),
('TW', _('Taiwan')),
('TJ', _('Tajikistan')),
('TZ', _('Tanzania, United Republic of')),
('TH', _('Thailand')),
('TG', _('Togo')),
('TK', _('Tokelau')),
('TO', _('Tonga')),
('TT', _('Trinidad and Tobago')),
('TN', _('Tunisia')),
('TR', _('Turkey')),
('TM', _('Turkmenistan')),
('TC', _('Turks and Caicos Islands')),
('TV', _('Tuvalu')),
('UG', _('Uganda')),
('UA', _('Ukraine')),
('AE', _('United Arab Emirates')),
('GB', _('United Kingdom')),
('US', _('United States')),
('UM', _('United States minor outlying islands')),
('UY', _('Uruguay')),
('UZ', _('Uzbekistan')),
('VU', _('Vanuatu')),
('VA', _('Vatican City State')),
('VE', _('Venezuela')),
('VN', _('Vietnam')),
('VG', _('Virgin Islands (British)')),
('VI', _('Virgin Islands (U.S.)')),
('WF', _('Wallis and Futuna Islands')),
('EH', _('Western Sahara')),
('YE', _('Yemen')),
('ZR', _('Zaire')),
('ZM', _('Zambia')),
('ZW', _('Zimbabwe'))
)
INSERT INTO `countries` VALUES (234, 'VG', 'Virigan Islands (British)');
should be
INSERT INTO `countries` VALUES (234, 'VG', 'Virgin Islands (British)');
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.