I have messed a bit (as far as my knowledge allows) with the charset/collation with phpMyAdmin.
Tried setting everything to utf8/utf8_bin to match my local database (that works fine).
Local Server Informations
Everything reads and writes correctly on my local server.
I’m using workbench to manage my local database.
Charset: utf8
Collation: utf8_bin
Other Information
All my pages have the meta charset=“UTF-8” and special characters written on the HTML displays correctly. So that’s probably not the cause. The problem only occours when dealing with the database.
But that just doesnt make sense. And as I mentioned, I run the same code, with a MySQL database on my localhost without any weird characters. The characterset/collation is there for it.
Moreover, both PHP and MySQL are global tecnologies. And we are talking about portuguese here. Not some hieroglyph written language.
I believe the issue might be probably related to some configuration on InfinityFree’s MySQL server. But I’m very new to all that stuff.
I think it worked. Even though the database looks all crazy now full of weird characters, my queries seem be functioning correctly so… I guess that’s it. Thank you
Like @anon19508339 said, it’s a phpMyAdmin issue. It’s not a MySQL issue, it’s not a code issue, it’s not a language issue. phpMyAdmin corrupts special characters for some unknown reason.
If you add special characters through phpMyAdmin, phpMyAdmin will mangle them and add corrupted data to your database. If you add correct data through the PHP code on your website, it will show as corrupted data in phpMyAdmin.