I want to update my value after 10 minutes of the first update
For example, I've sent this request:
UPDATE client set lockclient = 1 WHERE id = 100
I want to send another request after 10 minutes, as below:
UPDATE client set lockclient = 0 WHERE id = 100
I've found this example on google:
DELIMITER $$
CREATE EVENT deactivation
ON SCHEDULE EVERY 10 MINUTE STARTS CURRENT_TIMESTAMP
DO
BEGIN
UPDATE tbl SET tbl.active = FALSE WHERE id =10
END;
$$;
But I want to update only in the first 10 min, not for each 10 min. Can I do that with php, mysql or javascript ?
You can try Ajax with
setTimeout()
javascript function like this:1st option:
There are couple of ways. If you want the short path you can accomplish by doing this by sql.
2nd option:
I'm not sure what you mean by update just in the first 10 min? you can also use cron with php/mysql to do the update. You can setup a cron to do whatever, in this example run every 10 min