I want to apply filters on the basis of latitude and longitude. There is a table having column id, title, latitude, longitude (MySql) & I want to get the results in the range of 4 km as I am providing latitude and longitude of my current location.
SELECT * FROM ads WHERE (latitude = 26.85005 AND longitude = 26.85393) AND (longitude = 80.94964 AND longitude = 80.96595) HAVING acos(sin(1.3963) * sin(latitude) + cos(1.3963) * cos(latitude) * cos(longitude - (-0.6981))) <= 0.1570