I'm using a linux shared hosting account with godaddy and I can't seem to get stored procedures working correctly with my MySQL database. I can create them from within phpMyAdmin fine. I can also create them in MySQL workbench fine. However, whenever I try to call the stored procedures either from inside the SQL section of phpmyadmin or from a php page, I get an error:

"PROCEDURE databaseName.ProcedureName can't return a result set in the given context".

The database recognizes that the procedure exists.
Also, this is how I am creating the procedure:

USE `databaseName`;

DROP procedure IF EXISTS `ProcedureName`;

DELIMITER $$

USE `databaseName`$$

CREATE PROCEDURE `databaseName`.`ProcedureName` ()

BEGIN

SELECT * FROM tableName;

END

$$

DELIMITER ;

any help would be greatly appreciated.

Also, I'm not 100% sure that stored procedures are even able to be utilized with shared hosting accounts on godaddy, but I figured there probably was a way to use them since you have access to a MySQL database. However, if for some reason they are not able to be utilized please let me know that as well.

I'm not familiar with the implementation at the godaddy.com site -

however -

the most common problem with stored procedures that I see are when the USER ACCOUNT that you're using to call the stored procedure does not have EXECUTE privileges for the resource(s) related to running that procedure.

This gets especially sticky when nesting stored procedures as you need to evaluate privilege grants for ALL resources involved.

I hope this gives you a clue as to where to check next -

/David C.

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.