htdocs/datafile.php
changeset 20 e2f6e3af9959
parent 8 0acb8d9a3194
equal deleted inserted replaced
19:eb92dc5d9fb4 20:e2f6e3af9959
     1 <?php
     1 <?php
     2 header('Content-type: application/force-download');
     2 header('Content-type: application/force-download');
     3 header('Content-disposition: attachment; filename=stats-data.php');
     3 header('Content-disposition: attachment; filename=stats-data.csv');
     4 
     4 
     5 echo file_get_contents('../stats-data.php');
     5 require('../stats-fe.php');
     6 
     6 
       
     7 echo "channel,nick,timestamp\n";
       
     8 
       
     9 $q = eb_mysql_query('SELECT channel, nick, time FROM stats_messages ORDER BY message_id ASC;');
       
    10 
       
    11 while ( $row = mysql_fetch_assoc($q) )
       
    12 {
       
    13   echo "{$row['channel']},{$row['nick']},{$row['time']}\n";
       
    14 }
       
    15 
       
    16 mysql_free_result($q);