PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
execute stored proc with php and mdb2

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database
View previous topic :: View next topic  
Author Message
iverwell



Joined: 11 Mar 2007
Posts: 1

PostPosted: Sun Mar 11, 2007 6:01 pm    Post subject: execute stored proc with php and mdb2 Reply with quote

I know there is a function called executeStoredProc, could anyone share the sample code to invoke this function? btw I'm using MDB2 Mysqli extension. Million thanks!

Simon
Back to top
View user's profile Send private message
seanifool



Joined: 04 Jun 2008
Posts: 2

PostPosted: Wed Jun 04, 2008 12:13 am    Post subject: example code Reply with quote

good question simon...

why is there no example code on the web for how to use this executeStoredProc?

I simply can't get it working. I am getting the boring snoring mysql error message "can't return a result set in the given context" and there's no G-hits comparing that message and MDB2...

any one got executeStoredProc working with mysql? care to show us an example?

my current code that produces the above looks like this:
<?
$sr3 = $mdb2->function->executeStoredProc("give_me_a_whale" , array(1), array('id'=>'integer', 'name'=> 'text') );

if (PEAR::isError($sr3)) {
echo ('blimey!' . $sr3->getMessage().' - '.$sr3->getUserinfo());
}
?>

and the procedure (just a simple device to test this) looks like this:
CREATE PROCEDURE give_me_a_whale(IN wid INT)
BEGIN
SELECT id, name FROM whales where id=wid;
END;

any leads would be hugely appreciated!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software