I have in my database car incidents for example. These incidents have a latitude and longitude. On a mobile using the GPS, I get the user\'s location with his coordinates. T
SELECT 3963 * ACOS(
SIN(RADIANS($pointAlat)) * SIN(RADIANS($pointAlat)) + COS(RADIANS($pointAlat)) * COS(RADIANS($pointBlat)) * COS(RADIANS($pointAlong) - RADIANS($pointBlong)))
AS
distance;
Also, if you're looking for a good read/tutorial on this.. Check here http://www.phpfreaks.com/forums/index.php/topic,208965.0.html