本文实例分析了PHP调用MysqL存储过程的方法。分享给大家供大家参考。具体分析如下:
CREATE PROCEDURE和CREATE FUNCTION :
CREATE FUNCTION sp_name ([func_parameter[,...]])
RETURNS type
[characteristic ...] routine_body
proc_parameter:
[ IN | OUT | INOUT ] param_name type
func_parameter:
param_name type
type:
Any valid MysqL data type
characteristic:
LANGUAGE sql
| [NOT] DETERMINISTIC
| { CONTAINS sql | NO sql | READS sql DATA | MODIFIES sql DATA }
| sql SECURITY { DEFINER | INVOKER }
| COMMENT 'string'
routine_body:
Valid sql procedure statement or statements
当我们看完以后,就可以开始写一些简单的存储过程了,首先建立存储过程,Create procedure(子程序)、Create function(函数),代码如下:
<div class="codetitle"><a style="CURSOR: pointer" data="67404" class="copybut" id="copybut67404" onclick="doCopy('code67404')"> 代码如下: