I have a signup_table with the following columns: Firs name, Surname, Mobile Number, Email Address, Password and Confirm Password.
I am trying to create a trigger through which I can check if the data in the confirm password field is same as that of the password field. Can anyone please let me know how to create a trigger for the same?
Here is what I am doing:
CREATE TRIGGER confirm_password_trigger
BEFORE INSERT ON `signup_table`
FOR EACH ROW
BEGIN
IF NEW.confirm_password != New.password THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Password does not match';
END IF;
END