# PEAR question

**URL:** https://forum.kirupa.com/t/pear-question/68632
**Category:** programming
**Created:** [October 27, 2004, 2:48pm UTC](https://forum.kirupa.com/t/pear-question/68632 "2004-10-27T14:48:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DiGiTi](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digiti/32/251_2.png) [@DiGiTi](https://forum.kirupa.com/u/DiGiTi)
#### Post date: [October 27, 2004, 2:48pm UTC](https://forum.kirupa.com/t/pear-question/68632/1 "2004-10-27T14:48:31Z")

</div>

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](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

```auto
<?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();
?>

```
