#30 library/tables-overall-users-login.php

svn-development
open
nobody
5
2012-09-16
2011-04-02
No

Daily functions it's grouping days of deferents months

ORGIGINAL CODE:
$sql = SELECT UserName, count(AcctStartTime), DAY(AcctStartTime) AS Day FROM ".
$configValues['CONFIG_DB_TBL_RADACCT']." WHERE username='$username' AND acctstoptime>0 GROUP BY Day

Modified CODE:
$sql = SELECT UserName, count(AcctStartTime), DAY(AcctStartTime) AS Day FROM ".
$configValues['CONFIG_DB_TBL_RADACCT']." WHERE username='$username' AND acctstoptime>0 AND AcctStartTime>DATE_SUB(curdate(),INTERVAL (DAY(curdate())+30) DAY) AND AcctStartTime< now() GROUP BY Day

Discussion

  • Marco Segura

    Marco Segura - 2011-04-02

    Sorry i forgot " ORDER BY $orderBy $orderType" statement
    Modified CODE:
    $sql = "SELECT UserName, count(AcctStartTime), DAY(AcctStartTime) AS Day FROM ".
    $configValues['CONFIG_DB_TBL_RADACCT']." WHERE username='$username' AND acctstoptime>0 AND AcctStartTime>DATE_SUB(curdate(),INTERVAL (DAY(curdate())+30) DAY) AND AcctStartTime< now() GROUP BY Day ORDER BY $orderBy $orderType;";

     
  • Liran Tal

    Liran Tal - 2011-04-16

    Right but the point is showing exactly that.. the user's login through-out all the days in general, not for a specific month...

     
  • Marco Segura

    Marco Segura - 2011-04-16

    Ok I've inderstood, but I think is more useful get a detailed grapth by day of last month, same for monthly graphs, you must need wait at leat two years for get a real mean.
    So i've changed
    Daily Graph--> last month
    Monthly Graph--> last year
    Regards

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks