Jump to content

cron timer


mandukar

Recommended Posts

hi can someone do me a favor and see whats wrong with this script.

i'm trying to get it to reset people's accounts every few hrs however it doesn't seem to want to work..

theres one for 2hrs and another 24 hrs..

[tt]
<?php
// Enter the number of hours below.

$hours1 = 2;
$hours2 = 24;

//Hours calculation

$hours1 = $hours1*3600;
$hours2 = $hours2*3600;

$cron_timer = mysql_fetch_array(mysql_query
("select * from cron_timer where id=1"));

// Timer for 24 hours
if ($stat[lpv] > $cron_timer[lpv]) {
include("reset.php");
mysql_query("update cron_timer set lpv=lpv+$hours1 where id=1");
}

//End of 24 hour timer

$cron_timer = mysql_fetch_array(mysql_query
("select * from cron_timer where id=2"));

// Timer for 2 hour timer
if ($stat[lpv] > $cron_timer [lpv]) {
include("reset.php");
mysql_query("update cron_timer set lpv=lpv+$hours2 where id=2");
}

//End of 2 hour timer
?>
[/tt]
Link to comment
https://forums.phpfreaks.com/topic/36324-cron-timer/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.