Hi all,

I'm trying to run a stored procedure:

BEGIN

SELECT YFR_Master_Fundraisers.FRName, YFR_Master_Fundraisers.FRActive
FROM YFR_Master
INNER JOIN YFR_Master_Fundraisers
ON YFR_Master.FundRaiser = YFR_Master_Fundraisers.FRNameCode
GROUP BY YFR_Master.FundRaiser
HAVING MAX(YFR_Master.CollectionDate) < DATE_SUB(CURDATE(),INTERVAL 2 MONTH)
AND YFR_Master_Fundraisers.FRActive = 1;

END

But I'm getting the following error:

Procedure execution failed
1312 - PROCEDURE db355379982.Deactivate can't return a result set in the given context

Does anyone know why I might be getting this?

I've never used stored procedures before.

Thanks

Do you get this when you run the stored proc in phpMyAdmin (or another client), or when you run it from PHP? Based on this thread on SO.

It runs fine from php. I'm using Navicat for MySQL. Could that be the problem?

MySQL Version 5.1.67-log
PHP Version 5.2.17

In Navicat

The SP is called Deactivate

I run

CALL Deactivate

Hard to say if it works from PHP. Are you using the same credentials?

Sorry, what do you mean by "credentials"?

Same user as in PHP. If you are using a different one, with different priviliges, that could cause issues.

Oh I see. Yes, Same user.

Yeah. It might be time to. Thanks for the help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.