Which encoding and collation are best for MySQL with PHP?
Hello everyone! I'm a beginner PHP developer, and I'm having a problem choosing the right encoding and collation for MySQL. I've scoured many forums, but everyone says different things. Some recommend `utf8_general_ci`, others `utf8_unicode_ci`, and recently I learned about `utf8mb4`.
I have a simple PHP site with a feedback form where users can leave comments. I noticed that sometimes Russian letters are displayed as gibberish (e.g., "Привет!"). After much struggle, I figured out that the problem is with the table encoding.
Here's how I create the table:
```php
exec("
CREATE TABLE comments (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50),
message TEXT
) DEFAULT CHARS
```