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
SELECT p.*,m.descripcion as marca FROM productos p INNER JOIN marcas m on m.id_marcas = p.id_marcas INNER JOIN categorias c2 on p.id_categorias = c2.id_categorias WHERE p.id_categorias = '12' limit -8,8