TRIGGER in MySQL

Error Message

Error
SQL query:

CREATE TRIGGER log_status_change AFTER UPDATE ON discrepancies FOR EACH ROW BEGIN
IF OLD.status <> NEW.status THEN
INSERT INTO status_change_log (discrepancy_id, status, change_timestamp)
VALUES (NEW.discrepancy_id, NEW.status, NOW());
END IF;
END
MySQL said:
#1142 - TRIGGER command denied to user ‘if0_37350795’@‘192.168.0.6’ for table if0_37350795_stoughton.discrepancies

Other Information

Do I not have access to TRIGGER?

Per the error message, the TRIGGER command is not supported on free hosting.

More advanced SQL commands like trigger are not supported on free hosting. Upgrade to premium or implement the logic in PHP instead.

5 Likes

Thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.