2013-09-03开发笔记
Mysql 创建function
DROP FUNCTION IF EXISTS `delModule`; CREATE DEFINER = `root`@`%` FUNCTION `delModule`(`id` int) RETURNS varchar(64) BEGIN #Routine body goes here... DECLARE c INT; SET c = 0; select count(*) into c from modules where module_parent=id; IF c > 0 THEN RETURN CONCAT('There is some module''s parent module id=',id); ELSE DELETE FROM modules where module_id=id; RETURN 'Delete successful!dd'; END IF; END;
Mysql 执行function
select deleteModule(1);
Ejs 赋值 html属性
<tr target='id' ref='<%= module[i].id %>' >
DWZ 删除的写法
<a class='delete' href='/admin/deleModule?id={id}' target='ajaxTodo' tilte='Delete module ???'></a>
express 获取参数
req.query.id
参考资料
http://itgroup.blueshop.com.tw/charleen/blog?n=convew&i=10107
http://dev.mysql.com/doc/refman/5.1/zh/stored-procedures.html
http://expressjs.com/api.html#req.params;
http://heavengate.blog.163.com/blog/static/2023810532012629091449/