0

When I insert some data in the mysql with a form in my system it saves everything wrong, but if I insert manually through the phpmyadmin it goes smoothly and save everything OK.

in my html there is the meta tag saying charset UTF-8, and in my php ini, the charset says UTF-8.

To read the database theres no problem but to insert in it goes wrong, it was working just fine but somehow it stoped working and started doing this.

If i insert in the form this phrase

Soluções Técnicas

in the data base saves

Soluções Técnica

  • 7
    We can't help you without you showing your code. Please, take the [tour]. – Script47 Jun 05 '18 at 15:06
  • What is the error you are getting, Please post your error message – sree Jun 05 '18 at 15:09
  • If i insert in the form this phrase Soluções Técnicas, in the data base saves Soluções Técnica – user3573575 Jun 05 '18 at 15:13
  • Sounds like your DB has the wrong [collation](https://dev.mysql.com/doc/refman/8.0/en/charset-general.html). – MonkeyZeus Jun 05 '18 at 15:19
  • https://stackoverflow.com/q/367711/2191572 | https://softwareengineering.stackexchange.com/q/109982/103990 | https://dba.stackexchange.com/q/76788/29510 – MonkeyZeus Jun 05 '18 at 15:21
  • The Collation I set in the DB is utf8_general_ci and the field in the table is the same – user3573575 Jun 05 '18 at 15:21
  • Check your actual PHP file. Is IT in utf-8? – delboy1978uk Jun 05 '18 at 15:25
  • Sorry ,but which one ? I have a lot of forms in the system the only thing they share in common are the Header and Footer Files. – user3573575 Jun 05 '18 at 15:28
  • Are you able to output from old data from MySQL -> PHP -> YUOR page with special characters using same php file you work with? – Alex Jun 05 '18 at 15:30
  • Yes, the old data is OK in the DB. When I do the SELECT it brings everything just like the DB including the new bugged data. The problem is the data inserted through the form – user3573575 Jun 05 '18 at 15:34
  • @MonkeyZeus Collation affects ordering and string comparisons. This is an *encoding* issue. – tadman Jun 05 '18 at 16:55

0 Answers0