Link to home
Start Free TrialLog in
Avatar of Loganathan Natarajan
Loganathan NatarajanFlag for India

asked on

How can I find the nearest 3 zip codes locations from the zip code entered?

I am implementing Google Map Zip Code Search and my previous question here
I have 100 zip codes of US and it is all fixed zip codes with address and to be searched this database by the user to enter zip code only  ...
based on this How can I pull the nearest 3 locations from its database ? I mean nearest 3 zip codes to be find ? Please help me.

At present, my code is implemented just search for single zip code and the details fetched from the db and shown on the google map
Avatar of Jagadishwor Dulal
Jagadishwor Dulal
Flag of Nepal image

One of the good way to show exactly nearest 3 zip is adding nearest zip in database so that you can easily manage it.
I don't know about your table structure but may add nearest1, nearest2, nearest3 and zip code for them. But if you want to get zip code by increment no like 1111, 1112, 1113, 1114 when you select 1111 you may create a select query which can retrieve 3 records from current searched record if searched zip found.
Avatar of Loganathan Natarajan

ASKER

I have like this my table structure ?
<test_id>71</test_id>
<zipcode>93030</zipcode>
<test_name>This is name details</test_name>
<details>test</time_details>
<address>5, street</address>
<phone>32443-3244343</phone>
<ultrasound>no</ultrasound>
<spanish>0000</spanish>
<STDcode>0000</STDcode>
<post_test>0000</post_test>
<trals>0000</trals>
<bellas>0000</bellas>
<websiteurl>0000</websiteurl>
<fax>0000</fax>
<rtll>0000</rtll>
<ils>0000</ils>
<besat>0000</besat>
<carenet>0000</carenet>
<county>VC</county>

Open in new window

In fact, what I have the zip codes are only California
Then it's better to use http://www.zipmaps.net/ where it shows zips
SOLUTION
Avatar of Vampireofdarkness
Vampireofdarkness
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@ Ray_Paseur

Thanks, I will look at it.