mysql 触发器修改密码

#admin_before_insert
if (new.user_pass<>'' and new.user_pass is not null) then
	set new.user_pass=md5(new.user_pass);
else
	set new.user_pass=''
end if;
#admin_before_update
if (new.user_pass<>'' and new.user_pass is not null and new.user_pass<>old.user_pass) then
	set new.user_pass=md5(new.user_pass);
else
	set new.user_pass=old.user_pass;
end if;

posted on 2022-09-09 10:58  小馬過河﹎  阅读(23)  评论(0)    收藏  举报

导航