Following mysql query is giving the following error.
QUERY -
set @rollback = 0;
start transaction;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @rollback = 1;
INSERT INTO `tablea` (`date`) VALUES (NOW());
INSERT INTO `tableb` (`date`) VALUES (NOW());
INSERT INTO `tablec` (`date`) VALUES (NOW());
IF @rollback THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
error :
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 CONTINUE HANDLER FOR SQLEXCEPTION SET @rollback = 1' at line 1