Invalid SQL: SELECT COUNT(*) AS count, dateline FROM vb382_reputation WHERE whoadded = '3' AND dateline > (1291845130 - 86400) ORDER BY dateline ASC LIMIT 1; MySQL-Error : Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause