Home >Backend Development >PHP Tutorial >数据库 - php连接sql server使用sqlsrv_fetch_array无法查询超长数据

数据库 - php连接sql server使用sqlsrv_fetch_array无法查询超长数据

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:40:411169browse

服务器操作系统:Windows Server 2003
php版本5.3 vc6
数据库: sql server 2008

假设现在表A中有4个字段(id, name, content, flag),当content长度超长时,这条记录就查不出来了。php代码是这样写的

<code>$stmt = sqlsrv_query($sql);
$rs = array();
where($res = sqlsrv_fetch_array($stmt))
{
    $rs[] = $res;
}
</code>

返回的$rs是空的。

但是相同的代码在php 5.4 vc9上【本地开发环境,数据库连的服务器数据库】是可以查询的。所以是哪里的配置不对么?还是我写法不对?求教!

回复内容:

服务器操作系统:Windows Server 2003
php版本5.3 vc6
数据库: sql server 2008

假设现在表A中有4个字段(id, name, content, flag),当content长度超长时,这条记录就查不出来了。php代码是这样写的

<code>$stmt = sqlsrv_query($sql);
$rs = array();
where($res = sqlsrv_fetch_array($stmt))
{
    $rs[] = $res;
}
</code>

返回的$rs是空的。

但是相同的代码在php 5.4 vc9上【本地开发环境,数据库连的服务器数据库】是可以查询的。所以是哪里的配置不对么?还是我写法不对?求教!

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