PHP script to update MySQL table on a specific date and time?

Ratchetr

New member
Can you use a MySQL event? (I've never used them myself, so I don't know how well they really work in practice, but they look like exactly what you need here).

I would think you could create an event that runs every X seconds and does an update on the table based on opening date being < current time and active = N.

Another alternative would be to make active a computed column in the queries that access it, rather than an actual column in the table. But that only works if the date is the only thing that activates or deactivates the event.
 
Can you use a MySQL event? (I've never used them myself, so I don't know how well they really work in practice, but they look like exactly what you need here).

I would think you could create an event that runs every X seconds and does an update on the table based on opening date being < current time and active = N.

Another alternative would be to make active a computed column in the queries that access it, rather than an actual column in the table. But that only works if the date is the only thing that activates or deactivates the event.
 
I've had issues with CronTab before.
I have an event that has an opening and closing date in MySQL. The events by default are not active. In my MySQL, there's a field called "active" = "N" . What is an example I can do to check the opening date and update the active field to "Y" when that opening date has come?
 
Back
Top