$lng是你的经度,$lat是你的纬度
SELECT lng,lat,
(POWER(MOD(ABS(lng - $lng),360),2) + POWER(ABS(lat - $lat),2)) AS distance
FROM `user_location`
ORDER BY distance LIMIT 100
http://www.itnose.net/detail/6376993.html
$lng是你的经度,$lat是你的纬度
SELECT lng,lat,
(POWER(MOD(ABS(lng - $lng),360),2) + POWER(ABS(lat - $lat),2)) AS distance
FROM `user_location`
ORDER BY distance LIMIT 100
http://www.itnose.net/detail/6376993.html