Forum Moderators: coopster

Message Too Old, No Replies

Running mysql stored procedures?

         

fintan

1:58 pm on Oct 26, 2006 (gmt 0)

10+ Year Member



Hi I've a stored procedure on a mysql 5 database and I'm trying to run it. Here's my code

$rsDepartment = "CALL sp_Departments_List('fintan');";
$department = new Get_MYSQL_RS(); $department_rslts = $department->MYSQL_LOOP($rsDepartment);
print_r($department_rslts);

The class just connects to the mysql database & runs mysql_query($rsDepartment) then bangs it into different array types.

Here's the error I'm getting

Could not run CALL sp_Departments_List('fintan'); query PROCEDURE ucc.sp_Departments_List can't return a result set in the given context

I can run the sp using any gui based tool with the same username/password combo. So it can't be a permissions problem. Anyone any ideas? Thanks

fintan.

eelixduppy

2:06 am on Oct 27, 2006 (gmt 0)



I'm not familiar with the error given or the sample script you have posted. Giving some more code might enable us to help you a little better. On the other hand you should check your syntax and make sure that the query is running correctly. Also make sure to check your variable types and whatnot.

We have a nice thread on Troubleshooting [webmasterworld.com] from our Library [webmasterworld.com]. A quick read through there might also help you identify the problem.

Best of luck!

fintan

5:24 pm on Oct 27, 2006 (gmt 0)

10+ Year Member



Thanks for the reply eelixduppy

After a bit of research it seems php4 which I'm using doesn't support stored procedures. I'll have to upgrade to php5 to get access to pdo. Hopefully then I can run the sp then. Thanks

[ie2.php.net...]