SQL query:
CREATE TRIGGER tg_newuser_insert
BEFORE INSERT ON tbl_newuser
FOR EACH ROW
BEGIN
INSERT INTO tbl_seq VALUES (NULL)
SET NEW.id = CONCAT('YTUM', LPAD(LAST_INSERT_ID(), 8, '00000'));
END
See Question&Answers more detail:osMySQL said: Documentation
#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 'SET NEW.id = CONCAT('YTUM', LPAD(LAST_INSERT_ID(), 8, '00000')); END' at line 6