Storing German special characters into MySQL database [duplicate]

被刻印的时光 ゝ 提交于 2019-12-13 08:37:58

问题


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

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 &

but if I run the above pasted query manually to database, it stored properly.


回答1:


Maybe you should utf8_encode/utf8_decode your data before insert.

http://php.net/manual/fr/function.utf8-encode.php



来源:https://stackoverflow.com/questions/25286279/storing-german-special-characters-into-mysql-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!