问题
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