|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
MySQL 5 - Problems exporting data to Excel
I have a simple PHP file that extracts data from a MySQL Database table and outputs it to an Excel Spreadsheet. I have Excel 2007, but it is an issue with 2003 as well.
There are 10 php pages with the same code, and the only difference is a qualifier in the select statement to select specific data rows. For 6 months, all has worked with no issues. Yesterday, 2 of the 10 php pages now bring an error "Problems on Load - problems came up in the following areas during load: Table. This file cannot be opened because of errors. Errors are listed in C:\Documents and Settings\me\Local Settings\Temporary Internet Files\Content.MSO\F1C9FC58.log." The log shows this: XML PARSE ERROR: Null or missing attribute value Error occurs at or below this element stack: <ss:Workbook> <ss:Worksheet> <ss:Table> <ss:Row> <ss:Cell> <ss I think this has to be data related, since other php pages with the exact same logic work and even the 2 php pages that bring this error worked up until yesterday. I do not believe this is a php issue because of this. The error is definitely an MS Office error. Am I right in that this is being caused by the data or should I be looking at something else? Here is my PHP Code: PHP Code:
|
|
#2
|
|||
|
|||
|
try removing the [] from these parts:
PHP Code:
when you put [] after an array variable, it adds a new key into the array and whatever is after the = is added into that spot. you are basically making a multi-dimensional array where the first dimension is [0] and under that is the array with all the values you want. example: PHP Code:
Try running that if you need to see what I mean. |
|
#3
|
|||
|
|||
|
I forgot a major part of my code
Thanks, IAmALlama.
The real frustration I have is that my code works perfectly for 8 out of the 10 php pages using it. But........... When I tried to remove the two sets of brackets, it errored, and then I realized I left out an important piece of my issue (sorry - brain-fart on my part). I am using an include file from Oliver Schwarz that I had found earlier in a user group site. PHP Code:
The class-excel-xml.inc.php code: PHP Code:
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > MySQL 5 - Problems exporting data to Excel |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|