无法在给定的上下文中返回结果集 [英] Can't return a result set in the given context

查看:86
本文介绍了无法在给定的上下文中返回结果集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试在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".

我用google搜索过,有人说这是mysql bug,有人说您应该更改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:过程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 :-(

另一个想法是尝试使用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时,这是您可能感兴趣的另一篇文章,并且可能更易于测试:

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 ;-)

这篇关于无法在给定的上下文中返回结果集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆