在长时间计时器之后对db进行更改的方法

I want to execute a script after 24 or 48 hours I want to prevent sending emails for some users if they abuse so I'm wondering how to use a timer in php code or in the mysql db to set the duration and wait for it to finish and when it finish the user can messages mails back. witch is the best technique I heard about cron but if this can make the necessary then how to use it thank you for helping me in advance.

Sounds like you should calculate a timestamp at which the current user would be allowed to send emails again. Store this value in MySQL so that your email script can check this timestamp and decide if the user is allowed to send emails.

Create a new MySQL DATETIME column in your db. When you need to lock a user from generating emails, have your script check if we're at or past the timestamp value.

If not, block the process and inform the user. If so, allow the email to send.