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 '-18,18' at line 2; Query: select img.`id`, img.`name`, img.`image`, img.`description_image`, img.`enabled`, img.`category`, cat.`name` catname from `md_gallery1526032510` img left join el_modules_categories cat on = img.category where `enabled` = 0 order by version_date desc limit -18,18