Error in query: SELECT *, (((acos(sin((*pi()/180)) * sin((`lat`*pi()/180)) +cos((*pi()/180)) * cos((`lat`*pi()/180)) * cos(((- `lon`)*pi()/180))))*180/pi())*60*1.1515) as distance FROM `area` ORDER BY distance ASC LIMIT 0,14 . 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 '*pi()/180)) * sin((`lat`*pi()/180)) +cos((*pi()/180)) * cos((`lat`*pi()/18' at line 2