Page 1 of 1

SP first time in mySQL

Posted: Wed Jan 26, 2011 9:31 am
by Anant
Hi, I have written SP in SQL Server with .NET but this is my first time with mySQL and php -

Basically the SP takes one paramater which basically is querystring value - for instance - www.abc.com/def.php?name=testing

so i call sp from my php script as -

CALL xyz($name);

(Where xyz is sp name and $name is querystring value - testing in this case)

Finally am fetching the array to $member in sp and my question is how to return this result to php page from mysql sp ?

I hope this make sense.

thanks

Re: SP first time in mySQL

Posted: Wed Jan 26, 2011 1:28 pm
by John Cartwright
There is way too much documentation out there for me to even try to answer your question on stored procedures. See http://www.joeyrivera.com/2009/using-my ... mysqlipdo/ or if that doesn't do it for you, see http://www.google.ca/search?q=php+mysql ... =firefox-a

as for retrieving the query string parameter, you can access the named keys via $_GET. In your case,

Code: Select all

echo $_GET['name']; //echo's testing 

Re: SP first time in mySQL

Posted: Thu Jan 27, 2011 3:37 am
by Anant
Thanks for your reply but my question was not "how to access querystring value" but "how to access stored procedure result in php"

Re: SP first time in mySQL

Posted: Thu Jan 27, 2011 5:42 am
by VladSun
Did you read the articles John Cartwright pointed to?