Country/city dropdown list in the web-page
-
15-04-2021 - |
Pregunta
Where can I find a database of European countries and related cities to implement country/city dropdown list (dynamic) in the web-page?
UPDATE: I´m interested in some database that I can utilize from the javascript or php source code. This is to avoid manual work.
My answer: I have found one more good free resource: http://www.geodatasource.com/world-cities-database
Solución
MaxMind World Cities is a free list that you can download and use in your app (assuming that the license is ok for your purposes). Otherwise they've also got a webservice (though you have to pay for that).
An alternative is GeoNames.
Otros consejos
http://en.wikipedia.org/wiki/Europe#Political_geography
Wikipedia always works :)
For some reason I thought about capitals only, but I guess you mean all cities.
Take a look at: http://download.geonames.org/export/dump/
Check out the readme.txt which has more info. Perhaps cities1000.zip could be used as a base for you. Maybe you need to create a database with the countries you want, and then perhaps filter the list from the link above by ISO-code or something.
The readme also mentions some continent code, so maybe that can be of use?
http://www.webservicex.net/country.asmx/GetCountries list of countries in xml
http://www.timdavis.com.au/data/
Get an excel for list of country and state.
You need use Jquery for dynamic ajax dropdown list. See here php/ajax script -
http://myip.ms/info/cities_sql_database/
Cities table format will be -
CREATE TABLE `cities` (
`cityID` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`cityName` varchar(50) NOT NULL,
`stateID` smallint(5) unsigned NOT NULL DEFAULT '0',
`countryID` varchar(3) NOT NULL DEFAULT '',
`language` varchar(10) NOT NULL DEFAULT '',
`latitude` double NOT NULL DEFAULT '0',
`longitude` double NOT NULL DEFAULT '0',
PRIMARY KEY (`cityID`),
UNIQUE KEY `unq` (`countryID`,`stateID`,`cityID`),
KEY `cityName` (`cityName`),
KEY `stateID` (`stateID`),
KEY `countryID` (`countryID`),
KEY `latitude` (`latitude`),
KEY `longitude` (`longitude`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;