mysql 安插数据时中文变x87xE7xA7x91xE7x82这种

WBOY
Release: 2016-06-13 12:34:56
Original
1244 people have browsed it

mysql 插入数据时中文变\x87\xE7\xA7\x91\xE7\x82这种?
以下测试 参数都在服务端php文件定义,客户端并不传输;
$sqlstr 数据由adodb读mssql数据库,读出的中文转码:iconv("GBK","UTF-8",$str)

如果直接运行服务器端php文件,直接运行mysql inert 不会出问题

但是如果由客户端post到php,运行mysql 就报错:

Incorrect string value: '\x87\xE7\xA7\x91\xE7\x82...' for column 'typename' at row 1

如果echo $sqlstr 
输出:INSERT INTO dede_arctype SET id ='2001', reid ='1002', topid ='1002', sortrank ='50', typename ='妇科炎症', typedir ='{cmspath}/a' 没问题

直接在mysql-front运行:
  INSERT INTO dede_arctype SET id ='2001', reid ='1002', topid ='1002', sortrank ='50', typename ='妇科炎症', typedir ='{cmspath}/a' 也没问题

这是为什么???

mysql;
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!