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 'AND (planos.tipo_plano = 0 OR 0 = 0) AND planos.ativo = 1 ORDER BY ordem ASC, no' at line 1