0
I need to do a routine to check if the end date of a particular event has passed, that is if the date of the "end" field is lower than today’s date update to the "state" field to "finished".
I’m working on codeigniter 3.0
The sql code I know my problem is to have this code run every day for example at 00:00 every day it checked and changed the state. I still don’t have code developed from that routine because I don’t know how to do it anyway
Opa @Orannjamechanic, do you have any code you tried? It makes it easy for people to help you. Put an example of the field, date format and etc...
– KaduAmaral
Would that be the idea:
update eventos set status = 'finalizado' where end_date < now()
?– gmsantos
sql i know, the problem is how do I make it run this update every day? Thanks
– Laranja Mecânica
Click [Edit] and enter relevant details of your question, such as the database you are using, the structure of your table and what you have developed of code so far.
– gmsantos
@Orangemechanic then your question is different, and you already have the answer here.
– gmsantos
@gmsantos Thanks, didn’t even know the name of the procedure to do research, thank you
– Laranja Mecânica
even use cron if you have Cpanel will be easier to use
– user28266