mysql存储过程tips

来源:互联网 发布:开淘宝网店培训 编辑:程序博客网 时间:2024/05/07 19:36

示例:

 

create procedure proc_name (in parameter integer)
begin
declare variable varchar(20);
if parameter=1 then
set variable='MySQL';
else
set variable='PHP';
end if;
insert into tb (name) values (variable);
end; 

 

 

 

MySQL扩展也是支持存储过程的,不过只支持无返回结果的存储过程

可以使用mysqli来代替