mandukar Posted January 30, 2007 Share Posted January 30, 2007 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] Quote Link to comment https://forums.phpfreaks.com/topic/36324-cron-timer/ Share on other sites More sharing options...
mandukar Posted January 30, 2007 Author Share Posted January 30, 2007 bumping Quote Link to comment https://forums.phpfreaks.com/topic/36324-cron-timer/#findComment-172839 Share on other sites More sharing options...
mandukar Posted January 31, 2007 Author Share Posted January 31, 2007 bumping Quote Link to comment https://forums.phpfreaks.com/topic/36324-cron-timer/#findComment-173541 Share on other sites More sharing options...
Sir William Posted January 31, 2007 Share Posted January 31, 2007 Well, you have $hours1 and $hours2 backwards. But other than that, what is it doing or not doing that's causing your problems? Errors? Wrong results? We need more info. Quote Link to comment https://forums.phpfreaks.com/topic/36324-cron-timer/#findComment-173562 Share on other sites More sharing options...
mandukar Posted January 31, 2007 Author Share Posted January 31, 2007 nothing happens...I forward it to reset.php and it should carry out job's that I have in the reset.php document. Quote Link to comment https://forums.phpfreaks.com/topic/36324-cron-timer/#findComment-174012 Share on other sites More sharing options...
mandukar Posted February 1, 2007 Author Share Posted February 1, 2007 bump. Quote Link to comment https://forums.phpfreaks.com/topic/36324-cron-timer/#findComment-174443 Share on other sites More sharing options...
mandukar Posted February 1, 2007 Author Share Posted February 1, 2007 Oh sorry it activates the reset.php page of my site, which then resets some data in the database.and it is supposed to work every 2hrs and 24hrs but nothing happens. Quote Link to comment https://forums.phpfreaks.com/topic/36324-cron-timer/#findComment-174986 Share on other sites More sharing options...
Sir William Posted February 2, 2007 Share Posted February 2, 2007 Where is the array $stat[] coming from? I don't see that defined anywhere. Quote Link to comment https://forums.phpfreaks.com/topic/36324-cron-timer/#findComment-175229 Share on other sites More sharing options...
mandukar Posted February 2, 2007 Author Share Posted February 2, 2007 cuz its in my reset.php script, what the script above basiclly should do is automaticly activate reset.php Quote Link to comment https://forums.phpfreaks.com/topic/36324-cron-timer/#findComment-175752 Share on other sites More sharing options...
mandukar Posted February 3, 2007 Author Share Posted February 3, 2007 bump Quote Link to comment https://forums.phpfreaks.com/topic/36324-cron-timer/#findComment-176022 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.