The Little Guy Posted February 20, 2007 Share Posted February 20, 2007 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 More sharing options...
marcus Posted February 20, 2007 Share Posted February 20, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.