The following describes the stored procedures for calling input parameters and stored procedures for outgoing parameters in the MySQL stored procedure called by PHP. The Calling method is for your reference, hope to help you.
MySQL Stored Procedure for input parameters
$ SQL ="
Create procedure myproce2 (in score INT)
Begin
If score> = 60 then
Select 'pass ';
Else
Select 'no ';
End if;
End;
";
Mysql_query ($ SQL); // create a stored procedure of myproce2
$ SQL = "Call test. myproce2 (70 );";
Mysql_query ($ SQL); // call the stored procedure of myproce2. The result is invisible. You can see the result in cmd.
MySQL Stored Procedure for outgoing Parameters
$ SQL ="
Create procedure mypropushed (out score INT)
Begin
Set score = 100;
End;
";
Mysql_query ($ SQL); // create a stored procedure of myproc4
$ SQL = "Call test. myproc4( @ score );";
Mysql_query ($ SQL); // call the stored procedure of myproc4
$ Result = mysql_query ('select @ score ;');
$ Array = mysql_fetch_array ($ result );
Echo '<PRE>'; print_r ($ array );