Export to csv - GH action

Export form data to CSV with a WHERE clause error.

Overview

The issue occurs because the WHERE clause in the CSV Export GH action is missing quotes around the string value, causing a database error.
Modify the WHERE clause in the download form to include single quotes around the placeholder for the string value.

Answered
ni nilubon03 08 Oct, 2015
Hello,

I have a download form with radio button (input name is TimeFrame) to select time frame before downloading to csv format.
I have CSV Export v2 GH action.
I have TimeFrame in a database stored Spring, Summer, Fall value.

On Where clause in a download form, I have TimeFrame={TimeFrame}

When I select Spring and click submit to download, I received the error below

Unknown column 'Spring' in 'where clause' SQL=SELECT * FROM `xxxxx_chronoforms_data_xxxxx` WHERE TimeFrame = Spring ;

Did I miss something on the setting?

Thank you,
Nilubon
Gr GreyHead 08 Oct, 2015
Answer
Hi Nilubon,

Yes, you need quotes: WHERE `TimeFrame` 'Spring' so please try
`TimeFrame` = '{TimeFrame}' 
- the backticks `` aren't essential, but make the use clearer; the quotes '' are essential.

Bob
ni nilubon03 08 Oct, 2015
Bob,
It worked.
Thank you for your quick response,

Nilubon
This topic is locked and no more replies can be posted.