Changeset 591


Ignore:
Timestamp:
11/05/04 00:26:22 (15 years ago)
Author:
z0rglub
Message:

in queries table names use the constant and not hard coded table name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/stats.php

    r587 r591  
    4848 
    4949//---------------------------------------------------------------- log  history 
    50 $query = "SELECT DISTINCT COUNT(*) as p,  
    51   MONTH(date) as m, 
    52   YEAR(date) as y 
    53   FROM phpwg_history  
    54   GROUP BY DATE_FORMAT(date,'%Y-%m') DESC;"; 
     50$query = ' 
     51SELECT DISTINCT COUNT(*) as p, 
     52       MONTH(date) as m, 
     53       YEAR(date) as y 
     54  FROM '.HISTORY_TABLE.'  
     55  GROUP BY DATE_FORMAT(date,\'%Y-%m\') DESC 
     56;'; 
    5557$result = pwg_query( $query ); 
    5658$i=0; 
     
    6163  $current_month .= $row['m']; 
    6264  // Number of pictures seen 
    63   $query = "SELECT COUNT(*) as p, 
    64     FILE as f 
    65     FROM phpwg_history  
    66     WHERE DATE_FORMAT(date,'%Y-%m') = '$current_month' 
    67         AND FILE = 'picture' 
    68         GROUP BY FILE;"; 
     65  $query = ' 
     66SELECT COUNT(*) as p, 
     67       FILE as f 
     68  FROM '.HISTORY_TABLE.'  
     69  WHERE DATE_FORMAT(date,\'%Y-%m\') = \''.$current_month.'\' 
     70    AND FILE = \'picture\' 
     71  GROUP BY FILE 
     72;'; 
    6973  $pictures = mysql_fetch_array(pwg_query( $query )); 
    7074   
    7175  // Number of different visitors 
    72   $query = "SELECT COUNT(*) as p, login 
    73     FROM phpwg_history  
    74     WHERE DATE_FORMAT(date,'%Y-%m') = '$current_month' 
    75         GROUP BY login, IP;"; 
     76  $query = ' 
     77SELECT COUNT(*) as p, login 
     78  FROM '.HISTORY_TABLE.'  
     79  WHERE DATE_FORMAT(date,\'%Y-%m\') = \''.$current_month.'\' 
     80  GROUP BY login, IP 
     81;'; 
    7682  $user_results = pwg_query( $query ); 
    7783  $nb_visitors = 0; 
Note: See TracChangeset for help on using the changeset viewer.