DELIMITER $$
CREATE TRIGGER before_insert_wall BEFORE INSERT ON wall FOR EACH ROW
BEGIN
DECLARE x INT;
SET x = (SELECT count(*) FROM wall);
IF x > 10 THEN
DELETE
FROM wall
ORDER BY DATE ASC
LIMIT 1
END IF;
END&&
DELIMITER ;
只是什么都没有发生。我没有触发器出现在 phpmyadmin 中。