Possible Duplicate:
how to do location based search
Getting similar longitude and latitude from database
I have a dating PHP application working with MySQL database where users enter their location and based on it, other profiles are shown.
Structure of table cities
:
int id PK
int country_id FK
varchar(50) name
float longitude
float latitude
Example entry in table:
1 | 1 | New York | 23.20323 | 12.32356
And I want to select all cities which have longitude and latitude less then 23.20323 + 50 km, more then 23.20323 - 50km respectively.
The issue here is not a SQL syntax, but the actual radius calculation.