I have a project that wants to take in peoples country and state/prov names.
A select box is prefered, these will of course be dynamcally created from a db.
The problem is how to get all the state/prov codes easily into a db. Countries are easy as there is a resonable number of these but to do the state names by hand will be a monumental task.
Question is, is there a source out there that has the all the country states out there that can be easily converted to a db or does someone have one that they are willing to share?
Thanks
phpScott
country and state codes
Moderator: General Moderators
- Wayne Herbert
- Forum Commoner
- Posts: 34
- Joined: Tue Apr 29, 2003 3:13 pm
- Location: Houston, Texas
The CIA World Fact Book at
http://www.cia.gov/cia/publications/fac ... nt/ar.html
list the provinces/states for each country but not in a format that is readily adaptable for db usage... although you might be able to toss something together to break up a comma delimited list.
The State Department offers a list of countries with FIPS codes at
http://www.state.gov/www/regions/indepe ... tates.html
but there is no subdivision information.
An interesting list of countries and cities with a "dynamic weather server", whatever that is.
http://weather.interceptvector.com/list.php
A list of websites to official country pages
http://www.psr.keele.ac.uk/official.htm
I'd say the CIA pages would be the best bet. I reckon you could grab each page with a script, search for "Administrative Divisions", then grab the comma delimited list. It is still a big project. I'd love a copy of your DB when you get through.
http://www.cia.gov/cia/publications/fac ... nt/ar.html
list the provinces/states for each country but not in a format that is readily adaptable for db usage... although you might be able to toss something together to break up a comma delimited list.
The State Department offers a list of countries with FIPS codes at
http://www.state.gov/www/regions/indepe ... tates.html
but there is no subdivision information.
An interesting list of countries and cities with a "dynamic weather server", whatever that is.
http://weather.interceptvector.com/list.php
A list of websites to official country pages
http://www.psr.keele.ac.uk/official.htm
I'd say the CIA pages would be the best bet. I reckon you could grab each page with a script, search for "Administrative Divisions", then grab the comma delimited list. It is still a big project. I'd love a copy of your DB when you get through.
- daven
- Forum Contributor
- Posts: 332
- Joined: Tue Dec 17, 2002 1:29 pm
- Location: Gaithersburg, MD
- Contact:
I have a text file with countries and another one with USA states. The lines are separated with \n\r, and the fields are separated with \t. As for international provinces, I do not know where to get them.
Send me an email letting me know where to send the files.
To load them into a DB, just use a SQL statement with "LOAD LOCAL INFILE".
Send me an email letting me know where to send the files.
To load them into a DB, just use a SQL statement with "LOAD LOCAL INFILE".
list of countries and states
I actually have a link that lists all the countries using iso-3166 standards
http://www.tu-berlin.de/zrz/dienste/net ... -3166.html
and another that lists countries and their states or provinces
http://www.eki.ee/knab/adm2.htm
I am just trying to save some poor drone endless hours of data entry.
That poor drone just might be me.
I was wondirning how places like msn does it when you sign up for a new hotmail account the list of states/provinces. I know how to do the page reload but where the heck do they get that list, or do/did the have some one type that all in.
phpScott
http://www.tu-berlin.de/zrz/dienste/net ... -3166.html
and another that lists countries and their states or provinces
http://www.eki.ee/knab/adm2.htm
I am just trying to save some poor drone endless hours of data entry.
That poor drone just might be me.
I was wondirning how places like msn does it when you sign up for a new hotmail account the list of states/provinces. I know how to do the page reload but where the heck do they get that list, or do/did the have some one type that all in.
phpScott
You know I bet they did.
Quick Links:
America's States
Canada's Provinces
England's Regions
Germany's Regions
Quick Links:
America's States
Canada's Provinces
England's Regions
Germany's Regions
