Hi All,
I have a problem with a MySQL > Excel conversion script too.
My script would need to get a specific range from a database table
exporting certain search results to a simple Excel table.
The problem is the following:
when I submit my "Export to Excel" form, it gives variables to the export script through POST method.
If I comment the actual Excel Conversion prior to sending the headers, I will get the SQL query I desired by submitting the variables.
E.G.:
SELECT assetregion, assetcountry, assetcity, location, cat1, cat2, cat3, cat4, labid FROM assetdb WHERE dbid > 0 AND assetregion = 'NAR' AND ( assetstatus = '0' OR assetstatus = '1' OR assetstatus = '2' OR assetstatus = '5' OR assetstatus = '6' ) AND (assetname LIKE '%A%' OR nickname LIKE '%A%' OR labid LIKE '%A%' OR avaserial LIKE '%A%' OR venserial LIKE '%A%' OR assetid LIKE '%A%' OR comments LIKE '%A%' ) ORDER BY assetname ASC LIMIT 150,50 <<
But if I comment this and proceed with the excel table generation (can not echo if there are headers sent), the only troubleshooting opportunity I could think of is to echo the same actual query with the variables to the spreadsheet itself.
Now, if I do that, I get:
SELECT assetregion, assetcountry, assetcity, location, cat1, cat2, cat3, cat4, labid FROM assetdb WHERE dbid > 0 ORDER BY assetname ASC LIMIT 0,50 <<
for the same query! So it seems like ALL the variables I passed on to the script are disappeared and falled back to their original state (limit 0,50 should only occur of there are no values set/passed to the script).
Any ideas what is happening here?
Thanks!