MySQL geospacial search using haversine formula returns null on same point
I'm trying to implement a geospacial search in a php application. Currently, I'm using the following query to find points within 10km of a given latitude and longitude: SELECT * FROM ( SELECT *, (6378.1 * ACOS( COS(RADIANS(48.856614)) * COS(RADIANS(latitude)) * COS(RADIANS(2.3522219) - RADIANS(longitude)) + SIN(RADIANS(48.856614)) * SIN(RADIANS(latitude))) ) AS distance FROM `destinations_info` WHERE latitude BETWEEN 48.856614 - (10 / 69) AND 48.856614 + (10 / 69) AND longitude BETWEEN 2.3522219 - (10 / (69 * COS(RADIANS(48.856614)))) AND 2.3522219 + (10 / (69 * COS(RADIANS(48.856614)))) ) d