0
name_id(INT)(PRIMARY)   name(VARCHAR(50))   add_time(DATETIME)
        1                    stuff         2015-10-22 10:55:41
        2                    stuff         2015-11-25 14:54:20

I have table main as shown. User can add new stuff into this table.I want a trigger event that:

runs 10 minutes after the new row has been added into main

gets name_id for that new name

I now i need a MySql Event rather than a trigger since i want to wait 10 minutes. However i couldn't understand how i am gonna trigger this new event for a specific row rather than a whole table. Thanks.

Community
  • 1
  • 1

1 Answers1

0

You can write a trigger as usual but first call the sleep function, providing the number of seconds to sleep for (600 in your case) as an argument.

Emile Pels
  • 3,837
  • 1
  • 15
  • 23