Jump to content

Stored Procedures Help


iceangel89

Recommended Posts

i created a stored procedure

 

CREATE PROCEDURE GET_USER_ACL_BY_USERNAME (IN USR VARCHAR(255)) 
   BEGIN
   SELECT ACL.Action, ACL.Path FROM ACL
   WHERE ACL.UserGroup
   IN (
     SELECT Usergroup.GroupID
     FROM Users, UserGroup, Privilages
     WHERE Users.UserID = Privilages.UserID
     AND Usergroup.GroupID = Privilages.GroupID
     AND Users.UserName = USR
   );
   END|

 

then when i CALL it,

 

CALL GET_USER_ACL_BY_USERNAME ('emp1') 

 

it says

#1312 - PROCEDURE employeemanager.GET_USER_ACL_BY_USERNAME can't return a result set in the given context

 

whats wrong? how can i fix this? i just started stored procedures... and recommendations for Stored procedures resources at the same time?

Link to comment
Share on other sites

http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html

 

HERE IT IS:

For all of you getting "can't return a result set in the given context" errors when using PHP to execute stored procedures,

the mysql_connect flag is:

 

mysql_connect( host, databaseuser,password,TRUE, 131074)

 

Worked with mysql 5.0.20 and PHP 5.1.4

Also, stored procedures seem to close the connection when they've finished running in PHP.

Can be fixed using mysql_ping( db_resource_id ) to reinstate lost connections

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.