Hi there,
How to get near by locations (around 5km) using latitude and longitude?
even i got sql query :
my table structure:craete table ad_list(ad_list_id int(11) NOT NULL, lat decimal(10,6) NOT NULL, lng decimal(10,6) NOT NULL, PRIMARY KEY(
ad_list_id));
SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( $lat ) )
* cos( radians( $lng ) - radians(-122) ) + sin( radians(37) )
* sin( radians( $lat ) ) ) ) AS distance
FROM markers HAVING distance < 5 ORDER BY distance LIMIT 0 , 10;
Please give me a solution for this....