Country/city dropdown list in the web-page

8.4k views Asked by At

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

5

There are 5 answers

0
Hans Olsson On BEST ANSWER

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.

2
Sverker84 On

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?

0
user1137682 On
0
user2253362 On

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;
0
Onkar Janwa On

http://www.timdavis.com.au/data/

Get an excel for list of country and state.