Jump to content

Search By Distance


The Little Guy

Recommended Posts

Anyone know how you would search for people within a certain distance if you have these for column names:

 

ZIP   	 LATITUDE   	 LONGITUDE   	 CITY   	 STATE   	 COUNTY   	 ZIP_CLASS

 

so say I wanted to search for people within 5 miles of my zip code (55068) how would I search?

 

and in my other table I have this related column:

zip

 

Any Ideas?

Link to comment
https://forums.phpfreaks.com/topic/39251-search-by-distance/
Share on other sites

You would probably have to calculate the distance between each long and lat, and when the user searches the zip code select the long and lat from there and (check how many longitude decimals will equal up a mile) the distance between the two. ($zipsearch-$zipindb)

Link to comment
https://forums.phpfreaks.com/topic/39251-search-by-distance/#findComment-189116
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.