473,408 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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 9229
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

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

Similar topics

5
by: SuryaPrakash Patel via SQLMonster.com | last post by:
Dear Reader I am trying to design a database. How can I make best Judgement that Indexing (which I am trying to fix during Diagram Desingning process)is ok. I am able to identify the best...
6
by: Noozer | last post by:
I'm developing a database using MS Access and have come across a problem. The majority of my database is pretty straightforward "many to one" relationships. I have one relationship that is...
5
by: hfk0 | last post by:
Hi, I'm new to ASP.net, SQL Server and visual studio.net, and I'm having problem inserting and storing data from a web form to a SQL database. I created a simple ASP.NET web form, a simple SQL...
1
by: greg.scharlemann | last post by:
Does anyone know where I could find a complete city and state database for MySQL? I've looked at the Zip Code data on the census website, but don't know the best approach to get a .dbf file into...
10
by: somaskarthic | last post by:
Hi In my php page , there is a user registration form. Here the user has to select the country, state, city from the drop down box. How this can be handled in php? If a country is selected in a...
5
by: jakas | last post by:
Hi In my php page , there is a user registration form. Here the user has to select the country, state, city from the drop down box. How this can be handled in php? If a country is selected in a...
3
by: rizwanrazzaq | last post by:
Hi friends here is my coding.. but i m facing one problem .. i used both mathod SQL mathod and open Record Set. but in both i m getting error massage can anyone help me out regarding thi. Please...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
14
by: rashmidutt | last post by:
hello sir i am making project on vb.net language..and project is on hospital management..its major project..and too many fields are present in its data base..i was connecting data base in forms but...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.