English 中文(简体)
MySQL UTF8 问题
原标题:MySQL UTF8 Problem
  • 时间:2011-09-15 20:58:01
  •  标签:
  • mysql
  • utf-8

I have a strange UTF8 encoding problem, which I don t understand. If a friend of mine fills out a form on my webpage, then all german "umlauts" (ä,ü,ö) are displayed in strange chars in my database. When I do the same, they are displayed normally, how it should be. Everything is set to utf8_general_ci, so it should work. But it doesn t, when my friend fills out the form.

没有人向我提出建议?

感谢!

问题回答

尽管所有表格都是UTF-8,但数据库链接可能使用微粒-1。 您在<代码>上的产出 SHOW VARIABLES LIKE %character%; in MySQL? 在那里有任何微粒的迹象? 如果是的话,调整一下charset context,载于MySQL配置文件。

你没有具体说明你写你的口号,这似乎是基于联系的问题。 你们必须以人工方式设定连接,例如,在日本外务省,在连接点结束时进行跟踪?characterEncoding=utf8”

Run SET NAMES utf8 on mysql right after connection





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签