Forums

CSV Export Error

fgingras 24 Aug, 2016
Good Afternoon,

I created a form to export specified fields from a table. The export works if I do not included any Columns in the 'Include columns' field, but as soon as I enter even a single field name, the export presents the attached error.

The sql command I am attempting to build via the export is:

SELECT site_name, region, registration_year, sc_name, sc_email
FROM `jml_chronoforms_data_SiteRegistration`
ORDER BY region, site_name

At one point, this was working, but since it is only used once a year by the client I cannot say at what point in the last year it quit working.

Any suggestions are greatly appreciated.

Thank you!
GreyHead 25 Aug, 2016
Hi fgingras,

It's possible that something has changed as a result of a Joomla! upgrade - though I'm not aware of anything that would affect this.

Peering at the image you posted it looks as if the SELECT list is empty. If you specify a column list then please make sure that there are only commas and no spaces between the entries: site_name,region,registration_year,sc_name,sc_email (and the same with the order by list).

You could use a Custom Code action to add the query and load the results into the $form->data array for exporting . . .

But, frankly, if it's only used once a year I'd probably dump it from PHPMyAdmin or something similar.

Bob
fgingras 27 Aug, 2016
Thanks for the response. I also noticed that the SELECT list was empty, which is what prompted me to try removing each column one at a time until it ran, albeit with an empty list. I did make sure the list had no spaces, but I will try it again. Most likely, I will just use the Custom Code option.

Thank again!
This topic is locked and no more replies can be posted.