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 'pro.codigo_interno2 = img.codigo_sti AND pro.codigo_interno3 = img.codigo_cor G' at line 8