This question already has an answer here:
这个问题在这里已有答案:
- UTF-8 all the way through 13 answers
UTF-8一直通过13个答案
I'm having an issue with storing the German characters into MySQL database. Database Collation = utf8_bin
Also I'm firing a query to database before my original query that is
我在将德语字符存储到MySQL数据库时遇到问题。数据库排序规则= utf8_bin此外,我在原始查询之前向数据库发出查询
mysqli_query($connection, "SET NAMES 'utf8'");
Here is my Final Query=>
这是我的最终查询=>
INSERT INTO professionals(name,address,phone,description,homepage) VALUES('Dr. med. Monika Makvandi-Nezhad','Zweibrückenstr. 680331 München','089/29161489','Ärztin, Fachärztin für Psychiatrie & Psychotherapie, Fachärztin für psychosom. Medizin & Psychotherapie Weiterbildungen: Psychoanalyse, Psychotherapie','noch nicht hinterlegt')
Database doesn't store Ärztin
and Fachärztin für
and other German characters properly it's storing something like that Ärztin, Fachärztin für Psychiatrie &
数据库没有正确存储Ärztin和Fachärztinfür以及其他德国字符,它存储的内容类似于Auml; rztin,Fachä rztin fü r Psychiatrie&
but if I run the above pasted query manually to database, it stored properly.
但如果我手动将上述粘贴的查询运行到数据库,它会正确存储。
1 个解决方案
#1
0
Maybe you should utf8_encode/utf8_decode your data before insert.
也许你应该在插入之前utf8_encode / utf8_decode您的数据。
#1
0
Maybe you should utf8_encode/utf8_decode your data before insert.
也许你应该在插入之前utf8_encode / utf8_decode您的数据。