I'm very new to perl and mysql and am in need of a bit of help with a perl script that is doing query to mysql DB for radius. Currently the script is doing a sum of octects from DB by username only. My issue is that it is doing the sum for ALL entries from that username. What i need it to do is sum all database entries by username for the current date only. So that database entries for previous days are not included in the sum.
This is the portion of the script in question.
$cursor = $dbh->prepare("SELECT SUM(AcctInputOctets), SUM(AcctOutputOctets), SUM(AcctSessionTime)
FROM radacct
WHERE username='$ARGV[0]'")
or die("Couldn't prepare");
$cursor->execute;
Thanks for any help you can offer
This is the portion of the script in question.
$cursor = $dbh->prepare("SELECT SUM(AcctInputOctets), SUM(AcctOutputOctets), SUM(AcctSessionTime)
FROM radacct
WHERE username='$ARGV[0]'")
or die("Couldn't prepare");
$cursor->execute;
Thanks for any help you can offer