PHP gevorderde |
|
CREATE TRIGGER deleteolditems
AFTER INSERT ON agenda
FOR EACH ROW
BEGIN
DELETE FROM agenda WHERE endDate < DATE_SUB(CURDATE(),INTERVAL 30 DAY );
END;
CREATE TRIGGER deleteolditems AFTER INSERT ON agenda FOR EACH ROW BEGIN DELETE FROM agenda WHERE endDate < DATE_SUB(CURDATE(),INTERVAL 30 DAY ); END;
Merkt er iemand de fout. Als ik het rechtstreeks in PHPMyAdmin ingeef krijg ik de volgende fout:
[quote]Error
SQL query:
CREATE TRIGGER deleteolditems AFTER INSERT ON agenda
FOR EACH
ROW
BEGIN
DELETE FROM agenda WHERE endDate < DATE_SUB( CURDATE( ) , INTERVAL 30 DAY ) ;
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5 [quote]
|