I have a program that provides a database of business listings based on search criteria. If you add your zip code to the search criteria the program will calculate the distance between your zip code and each of the business listings and display that calculation in miles in the results.
What I need is the ability to sort the search results by the distance calculation. Since the distance is not stored in the database anywhere I cant find a way to do it.
Basically I just need to know if it can be done and how much to get it done.
You can view the code that does the distance calculation here [url removed, login to view]
That code basically provides an array of zip codes that are within a specified distance of the zip code you choose. My script matches the business listings (zipcodes) in my database with the zips in the array and displays the results.
let me know if you have any questions.