I have a problem with my sql loop.
Here is my code:
BEGIN DECLARE @id INT; DECLARE @count INT; SET @id = 1; SET @count = 0; WHILE (@count < @id) DO INSERT INTO members (id, description) VALUES ((@id+1), 'Hello World'); SET @count = (@count+1); END WHILE; END;
I have this error: #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 'DECLARE @id INT' at line 2
After I have also an error in the loop.
Do you have an idea of the errors?