I have two tables A and B. If I remove a entry in the table A, I want to update the status of the entry in the table B using the user id. I'm using this code:
CREATE TRIGGER blockuserundo BEFORE DELETE ON user_blocked
FOR EACH ROW BEGIN
UPDATE members SET ty_status = '1' WHERE user_id = OLD.block_user_id ;
END;
It shows an error like:
no new row in the trigger delete
Please guide me to write the query for the above scenario.