如果不能理解我的英语是因为我的英语很糟糕......我将尽力解释我的问题 .
我尝试在mysql(phpmyadmin)中创建存储过程,但我有这个错误:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
这是存储过程的代码:
CREATE PROCEDURE `sp_user_insert` (IN `sp_email` varchar(255), IN `sp_password` text, IN `sp_role` int)
BEGIN
DECLARE `sp_encrypted_password` text;
SET `sp_encrypted_password` = SELECT MD5(`sp_encrypted_password`);
INSERT INTO `user`( `user_email`, `user_password`, `user_role_id`) VALUES ( `sp_email`, `sp_encrypted_password`, `sp_role`);
END
这是表用户的代码:
CREATE TABLE IF NOT EXISTS `user` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`user_email` varchar(255) NOT NULL,
`user_password` text NOT NULL,
`user_role_id` int(11) NOT NULL,
PRIMARY KEY (`user_id`)
);
PD:对不起,我的英语不好:C
2 回答
看看这是否有帮助,您不应该需要
SELECT
来获取MD5哈希 .这会有所帮助 . 试试一次 .