Created
December 8, 2013 03:56
-
-
Save akozlik/7853184 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT *, (3959 * acos(cos(radians('".$lat."')) * cos(radians(lat)) * cos( radians(long) - radians('".$lng."')) + sin(radians('".$lat."')) * | |
sin(radians(lat)))) | |
AS distance | |
FROM carpark WHERE distance < 15 ORDER BY distance LIMIT 0 , 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment