-2

We have a table in database called validity and update 'inactive' automatically into database when validity will expire by current date

validity_from | validity_to | status
------------------------------------
28-05-2019    | 28-06-2019  | active
------------------------------------

How can i achieve this function in php

Please suggest and help me.

  • Why do you want to store this redundant information in the first place? The validity of any record can be determined on the fly whenever you read the data. Much less chance of things going sideways, because such an “automatic update” might fail at some point. – 04FS May 28 '19 at 07:03

1 Answers1

0

you can create a cron job that runs in background and update 'status' filed accordingly