htdocs/datafile.php
author Dan
Sun, 04 Jan 2009 16:42:52 -0500
changeset 45 53a50ba4d690
parent 20 e2f6e3af9959
permissions -rw-r--r--
Added last 60 minutes graph to index.php
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8
0acb8d9a3194 Welcome, modularization and stats.
Dan
parents:
diff changeset
     1
<?php
0acb8d9a3194 Welcome, modularization and stats.
Dan
parents:
diff changeset
     2
header('Content-type: application/force-download');
20
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
     3
header('Content-disposition: attachment; filename=stats-data.csv');
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
     4
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
     5
require('../stats-fe.php');
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
     6
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
     7
echo "channel,nick,timestamp\n";
8
0acb8d9a3194 Welcome, modularization and stats.
Dan
parents:
diff changeset
     8
20
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
     9
$q = eb_mysql_query('SELECT channel, nick, time FROM stats_messages ORDER BY message_id ASC;');
8
0acb8d9a3194 Welcome, modularization and stats.
Dan
parents:
diff changeset
    10
20
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
    11
while ( $row = mysql_fetch_assoc($q) )
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
    12
{
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
    13
  echo "{$row['channel']},{$row['nick']},{$row['time']}\n";
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
    14
}
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
    15
e2f6e3af9959 Stats now uses MySQL backend
Dan
parents: 8
diff changeset
    16
mysql_free_result($q);