I'm trying to create the following trigger in PHP admin but get the following error. I've set delimiter to '//
' but still no luck. Any help?
For your information the table is called 'users
' and I'm trying to add the UUID
to the primary key 'user_id
'
CREATE TRIGGER user_id_users_insert BEFORE INSERT ON 'users'
FOR EACH ROW
BEGIN
SET NEW.user_id=UUID();
END;
#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 ''users' FOR EACH ROW BEGIN SET NEW.user_id=UUID(); END' at line 1