There are 2 login and token fields in the table. How to make it so that after the information is recorded in the token field for the specified login, will this field be cleared in a day?
I use MySQL
There are 2 login and token fields in the table. How to make it so that after the information is recorded in the token field for the specified login, will this field be cleared in a day?
I use MySQL
Actually the question is, is it necessary to fulfill the request on a schedule?
If you think a bit, then most likely the problem can be reformulated as follows:
"It is necessary that the token be valid during the day"
It is solved easier and more standard. A datetime or timestamp type field is added to the table where the time at which the token was created is recorded.
Later on, when checking a token, the time of its creation is also checked. If the token was created during the current day, then the token is considered valid. If it was created earlier, it means that the token is non-working.
Source: https://ru.stackoverflow.com/questions/632547/
All Articles