i have downloaded whole database from geonames.org and imported all countries into mysql.
i wonder how i can get the continent, country, state, county when i got a city’s id?
cause i want to make a cascading list menu with these information.
thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Looking things over, all the data that you are asking for appears to exist in their dataset. The exact query you are looking for should be pretty easy to come up with assuming that you imported everything in a relatively straightforward fashion.
Basically, you’ll need to join the
geonamestable against theadmin1codesandadmin2codestables as they contain State and County information respectively. You’ll also need to create a table to store continent information and join against that table also. Then, you merely have your query match a specific city and connect all your joins.If you haven’t already, I’d recommend looking through their FAQ forum:
http://forum.geonames.org/gforum/forums/show/6.page.
There are posts there detailing importing the data into just about every major database, and also some information about chaining drop down lists.
If you have a more specific question, please post here so we can help.