无法在给定上下文中返回结果集
当我尝试在 mysql 中调用存储过程以返回结果集时,它一直说无法在给定的上下文中返回结果集".
When ever I try to call store procedure in mysql that sends back a result set, it keeps saying me that "can't return a result set in the given context".
我在谷歌上搜索过,有人说是 mysql 错误,有人说你应该更改 mysqli 驱动程序,然后......
I've google it and some said it's mysql bug, some said you should change your mysqli driver and ....
情况:
使用 mysqli 驱动客户端 API 库版本 5.0.51a,PHP 版本 5.2.4-2ubuntu5.6,使用 Zend 1.9 RC 1 Mysqli 适配器.
Using mysqli driver Client API library version 5.0.51a , PHP Version 5.2.4-2ubuntu5.6, Using Zend 1.9 RC 1 Mysqli adapter.
我该怎么办!?
推荐答案
不确定这是您问题的解决方案,但是尝试使用更新版本的 PHP 怎么样?
PHP 5.2.4 肯定很老了——所以,如果它是 PHP 的 mysqli 驱动程序中的一个错误,它可能已经被纠正了......
Not sure this is the solution to your problem, but what about trying with a more recent version of PHP ?
PHP 5.2.4 is definitly quite old -- so, if it's a bug in PHP's mysqli driver, it might have been corrected since...
实际上,在快速搜索之后,您看到的问题似乎已经出现在 PHP 5.2.3 和 PHP 5.2.4 之间(并且在 PHP 5.2.5 中仍然存在).
请参阅错误 #42548:PROCEDURE xxx 无法返回给定的结果集上下文(适用于 5.2.3 !!)
Actually, after a quick search, it seems a problem like the one you are witnessing has been introduced between PHP 5.2.3 and PHP 5.2.4 (and was still here in PHP 5.2.5).
See bug #42548 : PROCEDURE xxx can't return a result set in the given context (works in 5.2.3!!)
你能用 PHP 5.2.9 或 5.2.10 之类的东西进行测试吗?
我知道这些不是由 Ubuntu 提供的,即使在最新的 Ubuntu 稳定版本中 :-( 您可能必须从源代码编译 :-(
Are you able to test with something like PHP 5.2.9 or 5.2.10 ?
I know these are not provided by Ubuntu, even in the last Ubuntu stable version :-( You might have to compile from sources :-(
另一个想法是尝试 mith PDO_MySql 适配器:也许它可以与那个一起工作?
是否可以在不造成太多麻烦/无需花费数小时进行测试的情况下更换适配器?
Yet another idea would be to try mith PDO_MySql adapter : maybe it would work with that one ?
It might be possible to change Adapter without causing too much trouble / without taking hours to test ?
当您使用 Zend Framework 1.9 时,这里有另一篇您可能会感兴趣并且可能更容易测试的帖子:升级到 1.8 后存储过程错误
As you are working with Zend Framework 1.9, here's another post that might interest you, and might be easier to test : stored procedure error after upgrade to 1.8
一个简单的尝试解决方案是回到 Zend Framework 1.7 ;对你来说可以吗,只是为了测试?
An easy solution to try that would be to go back to Zend Framework 1.7 ; would it be possible for you, just to test ?
无论如何...祝你好运!
而且,如果您找到了解决方案,请不要忘记指出问题是什么,以及您是如何解决的;-)
Anyway... Good luck !
And, if you find the solution, don't forget to indicate what the problem was, and how you solved it ;-)
相关文章