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"; } ?> 
  • Php save as UTF8 for starters - Isaev
  • it's saved as utf8 - user
  • Do you mean text messages from php or sql response? - Isaev
  • <? php header ('Content-type: text / html; charset = utf-8'); ?> - Isaev
  • Use charset to set the encoding for the sql result of the query. - Denis

0