468,771 Members | 1,435 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,771 developers. It's quick & easy.

world database of country state and city

45
Hi everyone,

I need the world database of country state and city. Actually i have three drop down option in my project in 1st drop down country name should come from database and 2nd drop down state name should come from database according to country and in 3rd drop down cities name should come from database according to states.

I have tried many search engine but i could not get any proper info regarding this i mean some time i get whole country name or some time i gat only cities name that i do not want. and somewhere is paid.

If you have any info regarding free database then plz tell me the details.
i will be very grateful to you...

thanks

Tokcy
Apr 17 '09 #1
7 8986
Ciary
247 Expert 100+
do you have three different databases or 3 different tables within one datebase. in the first case its very simple. you simply use a select statement after you post one drop down list.

Expand|Select|Wrap|Line Numbers
  1. <?php if(isset($_POST["country"]){
  2.     $query = "SELECT * FROM states WHERE country =".$_POST["country"]
  3.     }if(isset($_POST["state"]){
  4.     $query2 = "SELECT * FROM cities WHERE state=".$_POST["state"]
  5.     }
  6.  
after this: execute the queries and use the resulting array to fill the drop down lists
Apr 17 '09 #2
Markus
6,050 Expert 4TB
@Ciary
I think it's the database that he's asking for - not how to query it.

Check out geo world map (bottom right); it may or may not be what you're looking for.

I'll move this question to misc because it is not specifically about PHP.

Moderator.
Apr 17 '09 #3
Markus
6,050 Expert 4TB
This looks even more promising.

- mark.
Apr 17 '09 #4
tokcy
45
I am not looking for php code i ma looking for country state and cities database of world...
Apr 18 '09 #5
Markus
6,050 Expert 4TB
@tokcy
Posts #3 and #4 should be of interest then.
Apr 18 '09 #6
tokcy
45
post #4 is not free, already i have checked and in post #3 there is no such type of link or option to take a any kind of database for world state and city...

thanks
Apr 18 '09 #7
Markus
6,050 Expert 4TB
@tokcy
Bottom right. GeoWorldMap.

It's not in SQL format, you'll have to do some work to convert it.
Apr 18 '09 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by SuryaPrakash Patel via SQLMonster.com | last post: by
6 posts views Thread by Noozer | last post: by
1 post views Thread by greg.scharlemann | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.