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 'Ávila') AND (`p`.`UF` LIKE 'BA') ORDER BY rand() LIMIT 6' at line 1
SELECT p.Indicativo,p.nome,p.sobrenome,p.cidade,p.UF,p.foto FROM gre_userperfil p WHERE (`p`.`id`!='2860' AND (`p`.`nome`!='' OR `p`.`sobrenome`!='')) AND (`p`.`cidade` LIKE 'Dias d'Ávila') AND (`p`.`UF` LIKE 'BA') ORDER BY rand() LIMIT 6Volta para o início