|
Posted by evan.lavidor on 03/21/06 22:23
Hi all,
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
parameter?
Thanks very much for any help, samples, or resources that anyone can
point me towards.
Evan
Navigation:
[Reply to this message]
|