Hi we are trying to build a filterable table using the WP wp data plugin, that shows answers to Event questions (dietary requirements, emergency contact etc.) in columns with the questions as the headers. The table is not structured like this so we would need something like a pivot, but I noticed that there is a registration CSV report that can be downloaded that shows the answers next to the registrants details in comma seperated with the questions as the headers. Can you help me with how i could replicate the CSV output as a SQL query?
Then it pulls the registrations for the current report in batches of 50 and loops over each registration in the batch – HERE.
For each iteration of the loop it adds all of the question labels for the export into each individual row array (after adding all of the ‘default’ column for that row) – HERE.
Then pulls all of the answers related to that rows specific registration – HERE
Then finally, loops over each answer and uses the related question values return to then find the question_label for the specific answer and add the answer into the CSR array above based on that label – HERE.
I don’t think you’ll be able to do that within a single query using the registrations but does the above plugin allow you to run additional queries per row?
No I dont think so. We have built some views in mysql which we have then queried because using the plugin, in order to resolve some filtering issues across joins. Do you think this might work with a mysql view?
Viewing 2 reply threads
The support post ‘Event questions SQL question’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.