将德语特殊字符存储到MySQL数据库中 [英] Storing German special characters into MySQL database

查看:365
本文介绍了将德语特殊字符存储到MySQL数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将德文字元储存到MySQL资料库时遇到问题。
数据库排序规则= utf8_bin
此外,我在我的原始查询之前向数据库发出

  mysqli_query($ connection,SET NAMES'utf8'); 

这是我的最终查询=>

  INSERT INTO专业人员(姓名,地址,电话,描述,主页)VALUES('Dr。med。Monika Makvandi-Nezhad','Zweibrückenstr。680331München','089/29161489' 'Ärztin,FachärztinfürPsychiatrie& Psychotherapie,Fachärztinfürpsychosom。Medizin& Psychotherapie Weiterbildungen:Psychoanalyse,Psychotherapie','noch nicht hinterlegt')

数据库不会正确存储ÄrztinFachärztinfür
它存储类似& Auml; rztin,Fach& auml; rztin f& uuml; r Psychiatrie& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp;

解决方案

但是如果我手动将上述粘贴的查询运行到数据库,您应该在插入之前utf8_encode / utf8_decode您的数据。



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


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.

解决方案

Maybe you should utf8_encode/utf8_decode your data before insert.

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

这篇关于将德语特殊字符存储到MySQL数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆