Всем привет, нужна помощь. Вот код:
```
<?php
$connect = new PDO ("mysql:host=localhost; dbname=db; charset=utf8_general_ci", '******', '********');
if (isset($_POST['username'])){
$username = $_POST['username'];
$comment = $_POST['comment'];
$date = date('H:i:s');
$query = $connect->query("INSERT INTO forum.comments (username, comment, data) VALUES ('$username', '$comment', '$date')");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>Форум</h2>
<div class="block">
<?
$comments = $connect->query("SELECT * FROM forum.comments ORDER BY data DESC");
$comments = $comments->fetchAll(PDO::FETCH_ASSOC);
if ($comments){
foreach($comments as $comment){
echo "<p>{$comment['data']}</p> {$comment['username']} :";
echo "<br>";
echo " {$comment['comment']}";
echo "<br>";
?>
<div class="line"></div>
<?
}
}else{
echo "Пока нет ни одного коментария :(";
}
?>
</div>
<form action="" method="POST">
<div class="block-comment">
<input type="text" name="username" placeholder="Ваше имя" required>
<textarea name="comment" cols="10" rows="5" placeholder="Ваш комментарий" required></textarea>
<input type="submit">
</div>
</form>
<style font-size=""></style>
</body>
</html>
```
Выскакивает ошибка: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2019] Unknown character set' in /var/www//data/www//index.php:2 Stack trace: #0 /var/www//data/www//index.php(2): PDO->__construct('mysql:host=loca...', '', '') #1 {main} thrown in /var/www//data/www/*****/index.php on line 2.
Помогите пожалуйста.