I'm trying to get the longitude and latitude around specific location. Actually I have some records (longitude and latitude
) in mysql table. Now i want tofetch those longitude and latitude from table which should have around 500 meter of specific longitude. Please view the code, i hope you will understand my question.
Mysql Location Table
-------------------------------------
id | longitude | latitude
-------------------------------------
1 | 25.058036 | 55.133467
-------------------------------------
2 | 25.056986 | 55.135755
-------------------------------------
3 | 25.059163 | 55.135616
-------------------------------------
4 | 25.056860 | 55.132515
-------------------------------------
5 | 25.055683 | 55.134792
I want to get those longitude, latitude which distance should have around 500 meters of specific (25.057550, 55.134729
).
$user_long= $_REQUEST['user_long']; // 25.057550
$user_lat= $_REQUEST['user_lat']; // 55.134729
Select * from location where .... (fetch record around 500 meters)
I have searched about it and find some well expnained haversine formula answer and Google Map With Php/Mysql but i did not got how can i develop this kind of functionality. I know this question may be stupid for someone because i'm not adding my code, but trust me i don't know how can i do it and from where i should start functionality. I will appreciate if someone guide me regarding this functionality.
Thank You