Web Programming, Linux System Administation, and Entrepreneurship in Athens Georgia

PROCEDURE can’t return a result set in the given context

I ran into a problem today when dealing with a very simple SQL Query. The query simply calls a stored procedure on the MySQL server. This is a trivial app, so I was using the very basic mysql_connect(), mysql_query() functions. The result wasn’t being returned an mysql_error() was saying that the error was:

PROCEDURE db.procedure_name can't return a result set in the given context

Of course ‘db.procedure_name’ was the actual name of the procedure I was calling. Googling for the error seemed to indicate that the MySQL client library was old, but this is on a fairly modern CentOS 5.5 server with the php-mysql package at version 5.1.6.

After a bit of experimenting, I found that I was able to change to using the mysql improved versions of the PHP functions and that worked fine

I’m using the mysql_query functions, and it works perfectly… Well, kind of. The thing is that I have two PHP files that make a call to a Stored Procedure. One file success, and the other returns that error “can’t return a result set in the given context”… Do you have any idea what could I be missing?