MySQL Forums
Forum List  »  PHP

Update column when datetime = NOW()
Posted by: Trevor Pan
Date: February 18, 2020 07:52AM

Hi,

developing a laravel app which uses mysql 8.

I have a column which is set upon creation to 0. I'd like to automatically update it to 1 when datetime = NOW().

Originally, had made a javascript component which called a method but later found out that calls the method/emails each time someone viewed the page.

I later thought perhaps a cron job would be suitable for this. So, run a job every minute in search of records where datetime >= NOW(). But that seems like it would update recently passed times but also ALL the other records that are >= NOW().

Any ideas?

Thank you,

Trevor

Options: ReplyQuote


Subject
Written By
Posted
Update column when datetime = NOW()
February 18, 2020 07:52AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.