php - Automatic update of MYSQL table according to date -
i have mysql
table holds events information. need mechanism updates status of each event according date ("over" if past date). what´s best way such thing? update status of event when user logs in (useless routine users), create sort of internal task (like cron job?), or other way. right now, status of event updated when creator logs in. works user see event "scheduled" until creator logs in, if date past. im using php
way. thanks
i recommend updating status time status requested. or better yet, don't store status in database @ all, compute each time it's requested based on other variables. way whenever have table list status or request status, take event date, compare today's date, , send them "not started", "ongoing", or "over".
unless of course need more possible statuses ("planning", "preparing", "setting up", etc). either need scheduled dates/times each of these statuses or need store status variable. either way, update status (according today's date , other pertinent information) @ time it's requested.
Comments
Post a Comment