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;
In reply to users online script not accurate by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |