I’m getting error msg’s with this script … could anybody help me who knows how to fix it ?
It gives me errors on this line : while($row=mysql_fetch_assoc($result)) {
url : http://www.digiti.be/koevanjoe/xls.php
this was just a simple test and doesn’t even work , bah !
Hope somebody can help me
Greetz,
DiGiTi
<?php
include("inc_admin_connect.php");
require_once '/usr/local/lib/php/Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();
$format_bold =& $workbook->addFormat();
$format_bold->setBold();
$worksheet =& $workbook->addWorksheet();
$worksheet->write(0, 0, "id", $format_bold);
$worksheet->write(0, 1, "Title", $format_bold);
$worksheet->write(0, 2, "Body", $format_bold);
$fullquery="select * from tips";
$result=mysql_db_query($db_name,$fullquery);
$i=1;
while($row=mysql_fetch_assoc($result)) {
$worksheet->write($i, 0, "$row[tipid]");
$worksheet->write($i, 1, "$row[title]");
$worksheet->write($i, 2, "$row[body]");
$i++;
}
$workbook->send('test.xls');
$workbook->close();
?>