There is such a code, the encoding is UTF-8, but the Russian characters are not displayed correctly, what should I add?
<?php $host='localhost'; // имя хоста $database='arcana'; // имя базы данных $user='root'; // заданное вами имя пользователя $pswd=''; // пароль $dbh = mysql_connect($host, $user, $pswd) or die("Не могу соединиться с MySQL."); mysql_select_db($database) or die("Не могу подключиться к базе."); $query = "SELECT * FROM `books`"; $res = mysql_query($query); while($row = mysql_fetch_array($res)) { echo "Номер: ".$row['title_book']."<br>\n"; echo "Email: ".$row['description_book']."<br>\n"; } ?>
charsetto set the encoding for the sql result of the query. - Denis