Geo Proximity Search in Large Database

I was creating an application with Geo Proximity Search capability
using PHP as server scripting language and MySQL as Database.

I got the solution that might help you.

If we have certain set of objects having their latitude and longitude, we can find some locations from my database with an specified location along with range/radius in KM we are using MySQL Query. Bellow is the given query where [table] means the storage where my all locations are stored and [latitude], [longitude]  are the specified location with whom we are going to compare.

SELECT [columns] FROM [table] WHERE 1=1 AND 3963.191 * ACOS((SIN(PI
() * [latitude] / 180) * SIN(PI() * [table].latitude / 180)) + (COS(PI
() * [latitude] /180) * cos(PI() * [table].latitude / 180) * COS(PI()
* [table].longitude / 180 - PI() * [longitude] / 180)) ) <= 15

Above calculations will give the objects that are within the 15 KM
area from the searched location’s center.