I am trying fetch all points within 50 km radius of user location from MySQL. For this I am using spatial data. I am trying to execute this query
select lat, lon from geom where
MBRContains(
GeomFromText('Polygon((46 -123, 48 -123, 48 -121, 46 -121, 46 -123))'),
p
);
For this I need to create a polygon(rectangle) which contains the current user geolocation. How can I build a polygon which contains the user co-ordinates and extends up to 50KM radius?