字符集和整理搞砸了? [重复]

This question already has an answer here:

I'm writing an html5 web page to store input from users in a MySQL database. The web page has tags <html lang="en">, <meta charset="utf-8"> and <form ... accept-charset="utf-8">.

I'm using PHP 5.4 and MariaDB 5.5.44. The database's character's set to UTF8. The table's character's set to UTF8. Collation is set to utf8_general_ci.

Why am I getting weird characters in my database? E.g. when I upload "á" it becomes "á"?

I'm pretty much a noob at coding and the docs go above my skill level.

</div>

Try this: Directly after the DB connection initialisation, insert

$mydb->set_charset("utf8");

(where $mydb is the variable for your db connection) In my case this helped in a similar situation.