Query runs in terminal but not in PHPMyadmin

Viewed 140

I am creating a trigger using this query

DELIMITER $$
CREATE TRIGGER `log_after_delete`
AFTER DELETE ON author FOR EACH ROW
BEGIN
    INSERT INTO `author_log` VALUES (OLD.author_name, CURRENT_TIMESTAMP);
END$$;

this query runs perfectly in terminal.

enter image description here

but when I tried with phpmyadmin, it shows error

enter image description here

Here is complete detail of Database server,webserver and phpmyadmin

enter image description here

Please suggest what is missing. Thanks in advance.

1 Answers

Try This

CREATE TRIGGER `log_after_delete`
AFTER DELETE ON author FOR EACH ROW
BEGIN
    INSERT INTO `author_log` VALUES (OLD.author_name, CURRENT_TIMESTAMP);
END

Then in phpmyadmin goto sql tab paste this query

And change the Delimiter there is ; change to // and go

Related