random1 Posted March 21, 2010 Share Posted March 21, 2010 I've got the SQL: CREATE PROCEDURE `procedure_add_new_user`(IN `p_user_name` VARCHAR(50)) LANGUAGE SQL NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER COMMENT 'Adds a new user (registration) to the \'user\' table.' BEGIN /* Adds a new user (Registration) */ INSERT INTO `user` (`user_profile_id`, `user_avatar_id`, `user_status`, `user_username`, `user_password`, `user_passphrase`, `user_title`, `user_firstname`, `user_lastname`, `user_datetime_utc_last_login`, `user_datetime_utc_created`, `user_date_of_birth`) VALUES (2, 1, 1, p_user_name, 'password', 'passphrase', 'Mr', 'Jacob', 'Mendlebury', UTC_DATE, UTC_DATE, '1984-08-12 00:00:00'); SELECT `user_id` FROM `user` WHERE `user_username` = p_user_name; END 'p_user_name' is the parameter I've created and I am calling it using: procedure_add_new_user('test'); It complains about syntax about an error on line 1 but I can't find an issue. Any ideas? Link to comment https://forums.phpfreaks.com/topic/195981-mysql-store-procedure-with-parameters/ Share on other sites More sharing options...
fenway Posted March 22, 2010 Share Posted March 22, 2010 Did you change the delimiter? Link to comment https://forums.phpfreaks.com/topic/195981-mysql-store-procedure-with-parameters/#findComment-1030189 Share on other sites More sharing options...
random1 Posted March 22, 2010 Author Share Posted March 22, 2010 I don't thinks so. Do you mean like: http://dev.mysql.com/doc/refman/5.4/en/stored-programs-defining.html Link to comment https://forums.phpfreaks.com/topic/195981-mysql-store-procedure-with-parameters/#findComment-1030220 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.