Problem inserting special characters in Mysql

0

When I enter some information in Mysql through the form on my system everything is wrong in BD, the characters ç ~ '^' buga everything, but manually entered in phpmyadmin. In HTML I put the meta charset UTF-8 tag and in php ini speech charset UTF-8

To read the BD infos everything is correct, not the problem. Just to enter.

  

Technical Solutions

The following is saved

  

Technical Solutions

Thanks for the help

    
asked by anonymous 05.06.2018 / 17:46

1 answer

0

Try to insert this code, at the end, into your file that allows you to validate the database:
... resto do código ... mysql_query("SET NAMES 'utf8'"); mysql_query('SET character_set_connection=utf8'); mysql_query('SET charecter_set_client=utf8'); mysql_query('SET charecter_set_results=utf8');

If you are using mysqli would be:

mysqli_query($conn,"SET NAMES 'utf8'");

...

Try also on all your files .php insert header ('Content-Type: text/html; charset=UTF-8');

    
05.06.2018 / 17:50