Distance between Postcodes

cRaZy-BoY

New Member
I am trying to find out the best way of working out distance between locations (we have the postcode and locations).Basically with each record we have a Location and Postcode, the user on the front-end can enter a postcode and select records ..\[code\]- Within 10 Miles- Within 20 Miles- Within 40 Miles- Within 50 Miles\[/code\]The only way I can see doing this is by getting EACH record from the database and working out the distance between each, entering it into a temporary table and then ordering this table by location and filtering it. This seems like a long-winded and time-consuming way of doing it - does anyone have any suggestions of how this could be done better? Or is this the best way of doing it?An example would be a customer enters SO40 9AA (Southampton Postcode) and then selects "within 50 miles", this should display and records within 50 miles of that postcode or location.
 
Back
Top