FROM radacct
WHERE UserName = ?
AND $str2time AcctStartTime ) >= ?
+ AND $str2time AcctStartTime ) < ?
AND ( ? - $str2time AcctStartTime ) ) < 86400
AND ( $str2time AcctStopTime ) = 0
OR AcctStopTime IS NULL )";
$sth = $dbh->prepare($query) or die $dbh->errstr;
- $sth->execute($end, $username, $start, $end)
+ $sth->execute($end, $username, $start, $end, $end)
or die $sth->errstr. " executing query $query";
my $start_during = $sth->fetchrow_arrayref->[0];