Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Below is a section of my users online script. It accurately reports the number of users currently online but it does NOT remove data from 24 hours ago. The script is supposed to keep just the last 24 hours of user data in the database and delete everything else.
Is there something perhaps with the logic?
my $timenow = time(); $minutes = $minutes * 60; my $timemin = $timenow - $minutes; my $data = qq(DELETE FROM now_time WHERE time < "$timemin"); my $sth = $dbh->prepare($data); $sth->execute() or die $dbh->errstr; my $day = 60 * 60 * 24; my $timeday = $timenow - $day; #print "Time day: $timeday <br> day: $day <br> Time: $timenow"; my $data = qq(DELETE FROM day_time WHERE time < "$timeday"); my $sth = $dbh->prepare($data); $sth->execute() or die $dbh->errstr;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: users online script not accurate
by cowboy (Friar) on Nov 07, 2005 at 19:55 UTC | |
by tweetiepooh (Hermit) on Nov 08, 2005 at 11:17 UTC | |
Re: users online script not accurate
by ickyb0d (Monk) on Nov 07, 2005 at 19:22 UTC | |
Re: users online script not accurate
by parv (Parson) on Nov 08, 2005 at 04:12 UTC |