插入数据库时出现奇怪字符的问题,不知疲倦地试图找出问题,但我没有想法......
基本上,如果我像这样插入这些数据(这只是测试):
$valy = "…industry's favorite </em><strong><em>party of the year</em></strong><em>, </em><a href='http://www.unitingagainstlungcancer.org/getinvolved/strolling-supper-with-blues-news'><span class='s1'><em>Joan's…";
$valy = mysql_real_escape_string($valy);
$query = "INSERT INTO test_table (data) VALUES ('".$valy."')";
mysql_query($query,$dbhandle);
这将在数据库中结束(注意 A 字符):
“...行业年度最受欢迎的 派对, http://www.unitingagainstlungcancer.org/getinvolved/strolling-supper-with-blues-news'>Joan's...”
我试图排列所有字符设置:
php default_charset = utf-8
mysql table & row charset = utf-8
Mysql instance variables:
character set client utf8
(Global value) latin1
character set connection utf8
(Global value) latin1
character set database latin1
character set filesystem binary
character set results utf8
(Global value) latin1
character set server latin1
character set system utf8
这个问题可能是什么?