Issue
I use phpMyAdmin version 4.1.14.8 and MySQL version 5.5
I have a procedure that does exactly what I want. I created it with the procedure popup-dialog in phpMyAdmin.
Now when I call it I just want to know if he created the entry or not.
Procedure is something like this:
INSERT INTO
`entries`
(`user_id`, `creationDate`, `description`)
SELECT
`user`.`id`, CURRENT_TIMESTAMP, description
FROM
`user`
WHERE
`user`.`session_id` != ''
AND
`user`.`session_id` = session_id
Now I wanted to set the newly created id as an OUT parameter with LAST_INSERT_ID() but I am unsure how to do this because whenever is use a semicolon to finish the first statement and just adding e.g.
SELECT
*
FROM
`entries`;
phpMyAdmin throws an error saying I should read the manual on how to do the whole part after the first semicolon =(
Solution
my problem here was that I assumed that phpMyAdmin would already add BEGIN
and END
to the procedure...
Answered By - cherry-wave
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.