From 35e72dbb7fd3c36232a9a3bf5a1d63a7ea7a136b Mon Sep 17 00:00:00 2001 From: Arnaud Ligot Date: Sun, 6 Mar 2011 15:47:27 +0100 Subject: [PATCH] adding column name --- main/reports/reports.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main/reports/reports.php b/main/reports/reports.php index 7ac2b18c1e..ccad2d0233 100644 --- a/main/reports/reports.php +++ b/main/reports/reports.php @@ -58,6 +58,11 @@ if (is_array($reports_template[$_REQUEST['type']])) { if ($_REQUEST['format'] == 'html') { echo ''; // FIXME style + $nfields = mysql_num_fields($result); + echo ''; + for ($i=0; $i < $nfields; $i++) + echo ''; + echo ''; while ($row = Database::fetch_row($result)) { echo ''; foreach ($row as $col) @@ -66,6 +71,10 @@ if ($_REQUEST['format'] == 'html') { } echo '
'.mysql_field_name($result, $i).'
'; } else if ($_REQUEST['format'] == 'csv') { + $nfields = mysql_num_fields($result); + for ($i=0; $i < $nfields; $i++) + echo mysql_field_name($result, $i).','; + echo "\n"; while ($row = Database::fetch_row($result)) { foreach ($row as $col) echo $col.','; // fixme