Abang Posted September 11, 2008 Share Posted September 11, 2008 Hi all, I really need help.. First sorry for my bad English.. Im making a course subsmission program for my staff. Admin will set the opening and closing date for each courses. Each course will be closed on their respective closing date. In "course" table i had 3 fields (start_date, close_date, status). The "status" value is either "open" or "close". For now, the value will be changed to "close" by Admin (thru web of course) when the courses had reached their respective closing date. My problem is, how do I automate this? How to do so "status" value will automatically change to "close", when that courses reached their closing date without Admin need to check it everyday? What function or trigger must I use? Countdown? Timer? I really got no idea on this, please help. Quote Link to comment https://forums.phpfreaks.com/topic/123718-solved-timer-in-php/ Share on other sites More sharing options...
discomatt Posted September 11, 2008 Share Posted September 11, 2008 SELECT `course` FROM `courses` WHERE `close_date` > NOW() Only select courses that aren't closed Quote Link to comment https://forums.phpfreaks.com/topic/123718-solved-timer-in-php/#findComment-638830 Share on other sites More sharing options...
Zane Posted September 11, 2008 Share Posted September 11, 2008 you going to have to set up a cron job to search the database for courses closing that particular day or time and have it run every day at a certain time, or ever hour, depending on how frequently professors close their courses Quote Link to comment https://forums.phpfreaks.com/topic/123718-solved-timer-in-php/#findComment-638838 Share on other sites More sharing options...
Abang Posted September 11, 2008 Author Share Posted September 11, 2008 Wow thats fast.. Thanks discomatt and zanus.. I think zanus answered me right... Maybe cron job will solved my problem.. But wait, I just realized that when I login to this forum, it ask me for how long I want to stay online... Maybe I can use the same technique here.. Cant I? And how? Please someone point me to the right direction.. Quote Link to comment https://forums.phpfreaks.com/topic/123718-solved-timer-in-php/#findComment-638854 Share on other sites More sharing options...
Zane Posted September 11, 2008 Share Posted September 11, 2008 Well, if you plan on setting a cookie somehow for all of this then yeah I guess you could do that. but I highly doubt you're setting cookies on this issue, are you.? Quote Link to comment https://forums.phpfreaks.com/topic/123718-solved-timer-in-php/#findComment-638855 Share on other sites More sharing options...
Abang Posted September 11, 2008 Author Share Posted September 11, 2008 You are right.. I think its not practical to use cookies on each courses.. Quote Link to comment https://forums.phpfreaks.com/topic/123718-solved-timer-in-php/#findComment-638861 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.