You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-6,6' at line 1 - SELECT `blog`.*, DATE_FORMAT(datapostagem, '%d/%m/%Y') as datapostagem2,DATE_FORMAT(ultimaModificacao, '%d/%m/%Y %H:%i:%s') as ultimaModificacao2 FROM `blog` WHERE excluido IN ('0','2') ORDER by ordem ASC LIMIT -6,6