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 '-30,30' at line 1 : select * from news where 1 and news_status='Active' and cat_parent_id='20' order by new_auto_id desc limit -30,30