There's a few questions like this on Stack Overflow but because i can't find any quite similar enough for me to follow.
I'm looking to select rows from db which are within x miles of a target.
example table columns:
| city_name(varchar) | lat(decimal) | lon(decimal) |
query effect i'm looking for (either using php or mysql)
$target_lat = ;
$target_lon = ;
"SELECT table.city_name WHERE (table.lat,table.lon) LESS THAN 20 MILES FROM ($target_lat,$target_lon")
obviously i don't expect query to take this structure! (i've never used Pi etc in mysql...)