I'm trying to run a mysql loop in phpMyAdmin in order to add price records for a number of products at the same time. When running this query I get the following 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 '$$' at line 11
Any idea why this would be?
DELIMITER $$
CREATE PROCEDURE doiterate()
BEGIN
DECLARE p1 INT Default 0;
label1: LOOP
SET p1 = p1 + 1;
IF p1 < 44 THEN
INSERT INTO `price`(`product`, `site`, `amount`)
VALUES (p1,'10','12.99');
END IF;
END LOOP label1;
END $$