Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
March 21, 2006, 8:23 pm
rate this thread
Forgive me if this topic has been discussed before. I've been doing
some searching and have yet to come across the answer I'm looking for.
I'm new to PHP, and I'm trying to call a MySQL stored procedure (using
mysqli) that has both input and output parameters. I have no problems
passing in the relevant params, but calling the output params is
confusing me. Most of the examples I see online deal with returning
recordsets, which I am not doing.
As a super-basic example, I've created the following sproc in MySQL:
CREATE PROCEDURE testproc(OUT p_testvar varchar(50)) BEGIN SET
p_testvar = 'HELLO WORLD!'; END
When I call this from MySQL I can do the following:
mysql> call testproc (@a);
mysql> select @a;
| @a |
| HELLO WORLD! |
1 row in set (0.00 sec)
But how would I do a similar call in PHP to retrieve the output
Thanks very much for any help, samples, or resources that anyone can
point me towards.
- » Form fields don't persist after window.open, form submit, browser back
- — Previous thread in » PHP Scripting Forum