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
Subject
Written By
Posted
Update column when datetime = NOW()
February 18, 2020 07:52AM
February 18, 2020 12:38PM
February 20, 2020 08:12AM
February 20, 2020 09:34AM
February 20, 2020 10:37AM
February 20, 2020 11:32AM
February 20, 2020 12:08PM
February 20, 2020 03:39PM
February 20, 2020 03:47PM
February 20, 2020 04:49PM
February 20, 2020 05:19PM
February 20, 2020 08:36PM
February 22, 2020 03:59PM
February 22, 2020 06:26PM
February 20, 2020 08:06AM
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.