A
A
Alexis_D2018-06-08 09:29:50
PHP
Alexis_D, 2018-06-08 09:29:50

Why does it issue questions when outputting from the database?

Good day, I uploaded the site to the hosting and when I output data from the database, instead of Russian characters, it gives me ????, that is, the word in the database "hello" - displays ?????? . At the same time, the encodings are all correct, how to be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lander, 2018-06-08
@usdglander

After connecting to the database, make a request
SET NAMES utf8;

U
ukoHka, 2018-06-08
@ukoHka

Perhaps the specified font is not available in the system or it does not support Cyrillic.
If it is, then the problem is in the encoding.
Check the encoding of the column in the database, the encoding when connecting (SET NAMES), the encoding of all files that process this line (including the output script) and the encoding of the page ( ) <meta charset="utf-8>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question