Home > Backend Development > PHP Tutorial > sqlserver2005-PHP通过ODBC连接SQLSERVER2005 查询不了中文

sqlserver2005-PHP通过ODBC连接SQLSERVER2005 查询不了中文

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-02 11:34:23
Original
1249 people have browsed it

sqlserver2005php中文乱码

PHP程序通过ODBC连接SQLSEVER2005数据库,
执行$sql=“select dbo.CPZL.*,dbo.CPFJ.ZMKC from dbo.CPZL LEFT JOIN dbo.CPFJ ON dbo.CPFJ.CPBH=dbo.CPZL.CPBH where dbo.CPZL.PM like N'%".“遥控车”."%'”
语句没有任何返回结果!“遥控车”字符换成英文或数字能够正常查询!
对语句进行字符集转换$sql=mb_convert_encoding($sql,'gbk','ascii,GB2312,gbk,UTF-8'),有的中文能正常查询,如“遥控车”但是有的中文不能正常查询如“水枪”!
而上面的语句,直接在SQL SEVER MANAGENENT 使用热河中文都能正常显示!

Related labels:
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