here is the procedure :
DELIMITER $$
CREATE PROCEDURE addcategorie (
nom varchar(50),
parent integer
)
BEGIN
DECLARE cat integer;
SELECT MAX(oc_category.category_id) + 1 INTO cat FROM oc_category;
INSERT INTO oc_category(category_id,parent_id,status ) VALUES(cat,parent,1);
INSERT INTO oc_category_description(category_id,language_id,name ) VALUES(cat,1,nom);
INSERT INTO oc_category_to_store(category_id,store_id ) VALUES(cat,0);
END $$
DELIMITER ;
execution : EXECUTE addcategorie(“test”,0);
MySQL said:
#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 '("test",0)' at line 1