Having Mysql Error

Discussion in 'PHP' started by NewTier, Apr 20, 2011.

  1. #1
    
    $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 -
     
    NewTier, Apr 20, 2011 IP