I have two .php files, a form with a text field where you put the names you want to search in the database, and a results file that processes the post…
The names in the database will be searched using this query:
SELECT * FROM acw_papers_web web
INNER JOIN acw_papers_web_autores aut
ON web.id_paper_web = aut.id_paper_web
WHERE aut.nombre_autor_pw LIKE '%autorname%'
ORDER BY web.probabilidad DESC
The problem is that when I send the post, insted of sending lópez, it sends lópez…
How can I fix it… both .php files are utf-8 encoded…
Since you did not provide much information, I cannot exactly pinpoint the problem. But here are two possible solutions:
Set the correct charset in the
<head>of both files:<meta charset="UTF-8" />for HTML5 or<meta http-eqiv="Content-Type" content="text/html; charset=UTF-8" />for everything elseSet the character set of the database tables to UTF-8. In MySQL:
ALTER TABLE acw_papers_web CHARACTER SET utf8 COLLATE utf8_general_ci;ALTER TABLE acw_papers_web_autores CHARACTER SET utf8 COLLATE utf8_general_ci;That’s all I could think of, for now.