import data from mysql data base to excel

Mar 14, 2010 at 3:28 AM


I'm new hier. For the present I'm sorry for my English.

A friend of mine recommended this website and I'm trying since a while to understand how I can use the classes from this website. I've downloaded the packet into my server and I've unzipped. First I've tested the testfiles, but it doesnt really work. For example I've tested '1.7.2/Tests/01simple.php', the result is:

'04:45:36 Create new PHPExcel object 04:45:36 Set properties 04:45:36 Add some data 04:45:36 Rename sheet 04:45:36 Write to Excel2007 format' this text ist showd in the browser instead a excel table.

Anyway I've read all of the discussions which is connected with 'import data from mysql data base to  excel'. I choosed a example from the discussion and put it into my programm code.   


    ini_set('include_path', ini_get('include_path').';../Classes/');

   include 'PHPExcel.php';

   include 'PHPExcel/Writer/Excel2007.php'; 

include 'PHPExcel/Writer/Excel5.php'; 
include 'PHPExcel/IOFactory.php'; 
$row = 1; $objPHPExcel = new PHPExcel(); 
while ($row = mysql_fetch_array($erg, MYSQL_NUM)) { $column = 'A'; 
foreach($row as $columnData)
{ $cellRef = $column.$row; $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellRef, $columnData); 
$column++; } $row++; } 

file echo date('H:i:s') . " Write to Excel2007 format\n";
echo date('H:i:s') . " Done writing file.\r\n";

objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));

the result is: there is no excel table and no error reporting. What is wrong hier? Can someone help me please?
the server which my programm lokates in : Apache2 (is a extern server)
my system software: windows vista
the programm is in utf-8 format

thank you