实例一:无参的存储过程 复制代码 代码如下: $conn = mysql_connect('localhost','root','root') or die ("数据连接错误!!!"); mysql_select_db('test',$conn); $sql = " create procedure myproce() begin INSERT INTO user (id, username, sex) VALUES (NUL
DELIMITER $$CREATE
/*[DEFINER = { user | CURRENT_USER }]*/
PROCEDURE `dpx`.`updatedchatroom`(IN p_UID INT ,IN p_updated BIGINT )
BEGIN
UPDATE im_friend SET updated=p_updated WHERE duid=p_UID;
UPDATE im_chatroom_user SET updated=p_updated WHERE uid=p_UID;
UPDATE im_chatroom
INNER JOIN im_chatroom_user ON im_chatroom.`_id`=im_chatroom_user.`chatroomId` SET im_chatroom.updated=p_updated WHERE im_chatroom_user.`uid`=p_UID;
END$$DELIMITER ;