I've a table with 2 fields filled : moment date Yes NULL status int(1) Yes 1 "moment" is filled with future dates and status is filled with "1" I need to check daily by 4:30 PM (IST), the status has to be auto-updated to '2' if "moment"= current date. That means, all "moment" values with today's date filled up, the correspding "Status" has to be updated automatically to value "2" EXACTLY by 4:30 PM IST. How to do this? Thanks in advance.
Are you asking for the query, or the method of execution ? Anyway, CURDATE() and cron ... Something like: UPDATE `table` SET `status` = '2' WHERE `moment` = CURDATE() AND `status` = '1'; Code (markup): I can never remember the stupid cron format ... remember to ascertain the timezone being used on the system where cron is executed.