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 * FROM `ck_news` where news_ON='Y' and news_Sdate <= '2024-09-17' and news_Edate > '2024-09-17' order by news_Sdate desc,news_id desc LIMIT -6,6;