Answer the question
In order to leave comments, you need to log in
How to solve access to mysql encoding problem using php?
There is an access database, you need to transfer one of the tables to mysql using php, everything works out, but instead of Russian words, there is a problem with the encoding. I don’t know how to fix it.
The encoding in mysql is UTF-8, I also tried cp-1251, in the first case there are cracks, in the second there are question marks ....
UPD. Solved the problem, added to my.cnf
[mysqld]
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci
init-connect="SET NAMES utf8"
skip-character-set-client-handshake
[mysqldump]
default-character-set=utf8
Answer the question
In order to leave comments, you need to log in
did it already (
the joke is that if you output it as an echo - the encoding is normal ...
and if you send it to mysql, then it's cracked ... cracked in the database itself
------
corrected the encoding in my.cnf, everything worked
mysql_query("set names 'utf-8'");
and also to the top of the page if php:
header('Content-Type: text/html; charset = 'utf-8'');
See what encoding is in the table settings and in the settings of each field.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question