Error in count items query! SELECT count(DISTINCT userID) as itemNum FROM leonardo_flights,leonardo_waypoints,leonardo_pilots WHERE (userID!=0 AND private=0) AND cat=1 AND DATE_FORMAT(DATE,'%Y') = 2009 AND ( excludeFrom & 1 ) = 0 AND leonardo_flights.takeoffID=leonardo_waypoints.ID AND leonardo_flights.userID=leonardo_pilots.pilotID AND leonardo_flights.userServerID=leonardo_pilots.serverID AND leonardo_waypoints.countryCode='LI'