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/

http://node-js.diandian.com/post/2012-07-03/40029704518

http://www.giantflyingsaucer.com/blog/?p=4241

posted @ 2013-09-03 21:55  yumuxu  阅读(124)  评论(0编辑  收藏  举报