javascript - How to change the field value after 'X' minutes of the first update -


i want update value after 10 minutes of first update

for example, i've sent request:

update client set lockclient = 1 id = 100 

i want send request after 10 minutes, below:

update client set lockclient = 0 id = 100 

i've found example on google:

   delimiter $$    create event deactivation     on schedule every 10 minute starts current_timestamp           begin         update tbl set tbl.active = false id =10       end;   $$; 

but want update in first 10 min, not each 10 min. can php, mysql or javascript ?

1st option:

there couple of ways. if want short path can accomplish doing sql.

//create event called my_update_event delimiter $$ drop event if exists my_update_event$$ create event my_update_event     on schedule         @ now() + interval 10 minute     on completion not preserve     enable begin     update tbl set tbl.active = false id =10; end$$ 

2nd option:

i'm not sure mean update in first 10 min? can use cron php/mysql update. can setup cron whatever, in example run every 10 min

*/10 * * * * /path/to/script/update.php 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -