简体   繁体   English

PDOStatement :: nextRowset()无法与dblib和MSSQL一起使用

[英]PDOStatement::nextRowset() not working with dblib and MSSQL

The Problem 问题

I have recently moved my web application from a Windows Server to a Linux Server, and in doing this, I have had to make a lot of changes... One of which is the way I communicate with my MSSQL server. 最近,我已将Web应用程序从Windows Server迁移到Linux Server,并且在此过程中,我不得不进行很多更改...其中之一是与MSSQL Server通信的方式。

I was using the Windows PDO_SQLSRV driver to speak to the databases, but am now using the dblib driver with Freetds etc. Everything works as it should apart from multiple recordsets and PDOStatement::nextRowset() . 我使用Windows PDO_SQLSRV驱动程序与数据库对话,但现在将dblib驱动程序与Freetds等配合使用。除了多个记录集和PDOStatement::nextRowset()外,其他所有功能都可以正常运行。 When I try to execute this function, I get: 当我尝试执行此功能时,我得到:

PDOStatement::nextRowset(): SQLSTATE[IM001]: Driver does not support this function: driver does not support multiple rowsets in /somefile/ PDOStatement :: nextRowset():SQLSTATE [IM001]:驱动程序不支持此功能:驱动程序不支持/ somefile /中的多个行集

What I have tried 我尝试过的

I have searched Google for this error and whilst I was able to find potential solutions (dating back to 2006), it seems none of these solutions are available. 我已经在Google上搜索了此错误,尽管我能够找到可能的解决方案(可追溯到2006年),但似乎没有这些解决方案可用。

I looked at this but wasnt able to implement the solution as it didn't say where it was. 我查看了此内容,但由于没有说明解决方案的位置,因此无法实施该解决方案。

My Question 我的问题

If not already clear, I need a way of returning multiple recordsets from an MSSQL databases via PHP on Linux, without getting the error that I am currently receiving... Is this possible? 如果还不清楚,我需要一种在Linux上通过PHP从MSSQL数据库返回多个记录集的方法,而不会得到我当前正在收到的错误...这可能吗?

Read this thread 阅读此主题

It seems to be on the Developer Todo list: 它似乎在“开发人员待办事项”列表中:

It Is doable. 这是可行的。 The native mssql/dblib extension does support that features. 本机mssql / dblib扩展确实支持该功能。 I just have'nt had the time to code it for pdo_dblib. 我只是没有时间为pdo_dblib编写代码。

Frank 坦率

If you consider writing parts of your scripts in native lib, [check here][2] 如果您考虑使用本地lib编写脚本的一部分,请[在此处检查] [2]


EDIT: 编辑:

It turns out the thread I linked to was old and the bug has been fixed since then. 事实证明,我链接到的thread很旧,并且此后该错误已得到修复。

The solution was to upgrade the PHP to a newer version. 解决方案是将PHP升级到新版本。

It turns out this issue was fixed in one of the later PHP versions. 事实证明,此问题已在更高的PHP版本之一中解决。 I do not know which version precisely, but I am now using PHP version 5.5.18 and nextRowset() is working as it should be. 我不知道确切是哪个版本,但是我现在正在使用PHP 5.5.18, nextRowset()可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM