Home  >  Article  >  Backend Development  >  php使用sqlsrv查询远路sql2008数据表中字段名为中文的字段取不到值

php使用sqlsrv查询远路sql2008数据表中字段名为中文的字段取不到值

WBOY
WBOYOriginal
2016-06-13 11:50:16982browse

php使用sqlsrv查询远程sql2008数据表中字段名为中文的字段取不到值
php使用sqlsrv查询远程sql2008数据表中字段名为中文的字段取不到值。如下所示:

查询语句:
select top 1 customid,需求id,需求类型,需求描述,解决时限,需求提交时间,标志,lastmodify from d_需求提交 order by customid

得到的结果:
客户编号: 500364, 需求编号: 需求类型: 需求描述: 解决时限: 需求提交时间: 标志: 最后修改人:1014
如上所示:只有customid和lastmodify取到了值

连接库时指定的编码:CharacterSet=>utf-8

急,在线等!


------解决方案--------------------
转义呀!
select top 1 customid,[需求id],[需求类型],[需求描述],[解决时限],[需求提交时间],[标志],lastmodify from [d_需求提交] order by customid

你在控制器里创建一个查询就知道该怎么写了

Statement:
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