通过SHOW VARIABLES LIKE 'character_set_%';查询出来的字符信息如下:
Variable_name  Value
character_set_client  utf8
character_set_connection  utf8
character_set_database  utf8
character_set_results  utf8
character_set_server  gbk
character_set_system  utf8
character_sets_dir  D:\DBServer\MySQL\share\charsets/通过SHOW VARIABLES LIKE 'collation_%';查询字符信息如下:
Variable_name  Value
collation_connection  utf8_general_ci
collation_database  utf8_general_ci
collation_server  gbk_chinese_ciphp页面编码为 gb2312请搞手指点。谢谢。

解决方案 »

  1.   

    mysql_query("set names 'gbk'")
    加到链接数据库之后,查询之前
    试试
      

  2.   

    超级汉,终于解决了。原来是英文版本源程序中有一个过滤特殊字符的函数在作怪。function securedata($mensaje)
    {
    $mensaje = htmlentities(stripslashes(trim($mensaje)));
    $mensaje = str_replace("'"," ",$mensaje);
    $mensaje = str_replace(";"," ",$mensaje);
    $mensaje = str_replace("$"," ",$mensaje);
    return $mensaje;
    }
    都是htmlentities惹的祸。
      

  3.   


    去掉这个函数你可能会出现其他问题。
    比如,你试试插入一些HTML标签看看