SELECT U.*,C.categoryTitle FROM `mx_post` AS U LEFT JOIN `mx_category` AS C ON U.categoryID=C.categoryID WHERE U.status='1' ORDER BY datePublish DESC LIMIT -8,8 SELECT U.*,C.categoryTitle FROM `mx_post` AS U LEFT JOIN `mx_category` AS C ON U.categoryID=C.categoryID WHERE U.status='1' ORDER BY datePublish DESC LIMIT -8,8 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-8,8' at line 1