I an working on a stored procedure for adding a new node to a php tree. Here is the procedure that I am trying to do:
I get this error when I try and create it
When I run the code manually, all works fine, what am I doing wrong?
Thanks for the help,
timgerr
-How important does a person have to be before they are considered assassinated instead of just murdered?
So there you go! You're the retarded offspring of five monkeys having butt sex with a fish-squirrel! Congratulations!
Code:
DELIMITER //
CREATE PROCEDURE TestThree()
SELECT @myRight := rgt FROM nested_category
WHERE name = 'TELEVISIONS';
UPDATE nested_category SET rgt = rgt + 2 WHERE rgt > @myRight;
UPDATE nested_category SET lft = lft + 2 WHERE lft > @myRight;
INSERT INTO nested_category(name, lft, rgt) VALUES('OtherThings', @myRight + 1, @myRight + 2);
END //
DELIMITER ;
I get this error when I try and create it
Code:
ERROR 1064 (42000): 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 ';
UPDATE nested_category SET rgt = rgt + 2 WHERE rgt > @myRight;
UPDATE nested' at line 3
Thanks for the help,
timgerr
-How important does a person have to be before they are considered assassinated instead of just murdered?
So there you go! You're the retarded offspring of five monkeys having butt sex with a fish-squirrel! Congratulations!