htdocs/datafile.php
author Dan
Tue, 30 Dec 2008 06:16:54 -0500
changeset 37 c3cbefda414a
parent 20 e2f6e3af9959
permissions -rw-r--r--
Merging apparently split branches
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);