Forum Moderators: coopster

Message Too Old, No Replies

Timed chagning of variable

         

wonderboy

4:59 pm on Jul 19, 2004 (gmt 0)

10+ Year Member



Hi,

How do I set the variable "lock" stored in table "status" to "1" at 1am on a specified date?
(This is a PHP and MySQL site)...

The table status only has 1 row, it acts as a series of switches saying what areas of the site are accessible.

Thanks for your help,

W.

jatar_k

5:32 pm on Jul 19, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the first thing that comes to mind is a nightly cron tha checks the date and sets various switches accordingly.

ergophobe

9:50 pm on Jul 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A much less efficient way would be to check whenever accessed and changing it if it's after 01h00 on the date in question. Jatar_K's method has no overhead on the page request and, ostensibly, only runs at 01h00, a low traffic time. But if you are on a shared host that won't support chron jobs, you could work around that way.