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 'ANDposicao = 'G' and ativo = 'S' ORDER BY ordem ASC LIMIT 0, 100) UN' at line 1