SELECT cityName , cityAvgPrice, cityID, (((acos(sin((*pi()/180)) * sin((`cityLat`*pi()/180))+cos((*pi()/180)) * cos((`cityLat`*pi()/180)) * cos(((- `cityLon`)*pi()/180))))*180/pi())*60*1.1515*1.609344) as distance FROM tp_cities WHERE `cityLat` IS NOT NULL AND `cityLon` IS NOT NULL AND cityAvgPrice > 10 ORDER BY distance ASC LIMIT 50
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((`cityLat`*pi()/180))+cos((*pi()/180)) * cos((`cityLat`*pi()/1' at line 1