$query = "SELECT *, truncate((degrees(acos(sin(radians(lat)) * sin(radians(".$latitude.")) + cos(radians(lat)) * cos(radians(".$latitude.")) * cos(radians(long – ".$longitude.")))) * 69.09),1) as distance FROM news2 HAVING distance < $max_distance"; Code (markup): I cannot get this to work. It keeps outputting that there is an error with my usage starting from the -