SP first time in mySQL

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Anant
Forum Commoner
Posts: 66
Joined: Wed Jul 14, 2010 11:46 am

SP first time in mySQL

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: SP first time in mySQL

Post 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 
Anant
Forum Commoner
Posts: 66
Joined: Wed Jul 14, 2010 11:46 am

Re: SP first time in mySQL

Post 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"
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: SP first time in mySQL

Post by VladSun »

Did you read the articles John Cartwright pointed to?
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply