我想從mqysql獲得最近的座標,但在語法中出錯!mysql select座標錯誤
$ lat = latitude; $ long = longitude;
"SELECT * FROM `b_location` WHERE round(lat,3) LIKE $lat
AND round(long,2) LIKE $long order by acos(cos(radians($lat))*cos(radians(lat))*cos(radians(long)-
radians($long))+sin(radians($lat))*sin(radians(lat)) LIMIT 0,1"
錯誤:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0,1' at line 1
所有評論歡迎
有時它的小事情很重要:) – arjun 2012-02-03 09:50:37