Error in count items query! SELECT count(DISTINCT userID) as itemNum FROM leonardo_flights,leonardo_pilots WHERE (userID!=0 AND private=0) AND ( excludeFrom & 1 ) = 0 AND leonardo_flights.category='4' AND leonardo_flights.userID=leonardo_pilots.pilotID AND leonardo_flights.userServerID=leonardo_pilots.serverID