0

So my hosting provider has informed me that i can not use Events as i need a super privilege to access it. So i have tried to replicate the same code into a trigger and still have no idea how to get it working.

i have a TIMESTAMP in my table called timer. So after a given time i want to delete the records older than 1 minute.

enter image description here

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
  • Deleting records automatically is typically more trouble than it's worth. There's a high risk of records will get deleted accidentally when someone makes a mistake. Is there a reason that doing a delete in code at the right time isn't possible? – jpmc26 Feb 25 '17 at 23:56

1 Answers1

0

The body of the trigger attempts to perform a DELETE from table wp_wpgmza. But that is the table the trigger is defined on. This violates the restriction documented in the MySQL Reference Manual

A stored function or trigger cannot modify a table that is already being used (for reading or writing) by the statement that invoked the function or trigger.

https://dev.mysql.com/doc/refman/5.7/en/stored-program-restrictions.html

The DELETE statement appears to be valid. But it can't be executed from the context of a trigger on the wp_wpgmza table. The statement will need to be executed in some other context.

spencer7593
  • 106,611
  • 15
  • 112
  • 140