Hi guys.
I am stuck with one issue... i need to export a mysql query to excel.. the query works fine on the webpage and pulls out all the data that i need but i need to export that to excel with heading. i can pull it from the php admin but i cannot pull it from a a webpage .. like you click on the link and you get a option to save a file and when you open it it has all your data. now i am using vertrigo... and i need some help with how to go about it....

so if someone has a code which that do the same for me that would be really appreciated

    5 days later

    when i am tring to chnage it to my table name and the column.. i am getting the error msg as

    Parse error: syntax error, unexpected T_SL in C:\Program Files\VertrigoServ\www\ecel\excelwriter.inc.php on line 100

    Plese let me know what wrong am i doing

      a month later

      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!

        Write a Reply...