Planning on developing a LAMP web application that allow users to specify their location. I could possibly use Google Map API to convert their location into lat/long coordinates. Assume each user has lat/long coordinates, how do I do the following:
- display the distance between 2 users?
- search for users within a given radius?
UPDATE:
SOLUTION USING MySQL: MySQL Great Circle Distance (Haversine formula)
Here is a MySQL stored function I wrote only the other day to calculate Haversine distance:
In this question:
Why does this MySQL stored function give different results than to doing the calculation in the query?
Usage: