2

I'm not quite sure how to ask this, but here goes. I have a MySQL table that has the following fields: dateRegistered and expiryDate .The fields are quite self explanatory, now what I am trying to achieve is have a php script be executed when the date on the expiryDate is reached. I really don't know where to start. Example:

+--------+---------------------+---------------------+
| userID |    dateCreated      |      expiryDate     |
+--------+---------------------+---------------------+
|  52    | 2015-10-08 13:30:17 | 2015-10-09 13:30:17 |
+--------+---------------------+---------------------+

When the date under expiryDate is reached, a php script gets triggered. Is this possible? Are the ways

5
  • 3
    Yes it possible. Use CRON in PHP. Commented Dec 3, 2015 at 12:06
  • code.tutsplus.com/tutorials/… Commented Dec 3, 2015 at 12:09
  • 1
    Possible duplicate of PHP script to execute at certain times Commented Dec 3, 2015 at 12:26
  • Thank you so much for your responses guys, I will look into them. Much appreciated Commented Dec 3, 2015 at 13:14
  • I do this using cron (I'm guessing if you're on windows you'd use Scheduled Tasks) to run a script which then checks the dates and acts accordingly. Perhaps not the best or most efficient way, but it does work well. Commented Dec 3, 2015 at 18:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.