K
K
khodos_dmitry2019-10-12 19:42:22
MariaDB
khodos_dmitry, 2019-10-12 19:42:22

Why doesn't SET NAMES 'utf8' work?

At the beginning of the script, I ran the following queries:

$pdo_link->query("SET NAMES 'utf8'");
$pdo_link->query("SET CHARACTER SET 'utf8'");
$pdo_link->query("SET SESSION collation_connection = 'utf8mb4_unicode_ci'");

But in base all the same krakozyabry.
In the test script I ran the following code:
$pdo_link->query("SET NAMES 'utf8'");
$pdo_link->query("INSERT INTO `names` SET `name` = 'Поехали'");

Recorded fine.
Should this setting be done before each request? Or how often? Or what's the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question