SQL:
CREATE FUNCTION delete_user (uId INT) RETURNS BOOLEAN
BEGIN
IF uID >= 0 THEN
START TRANSACTION;
DELETE FROM Folder WHERE u_id = uId;
DELETE FROM `User` WHERE id = uId;
RETURN 1;
END IF;
RETURN 0;
END;
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 4
Where is the syntax error?
START|BEGIN TRANSACTIONwith noCOMMIT?auto_commitis on then you don't need to dostart transaction;