I'm trying to create a script that will run via cron and pull the most recent survey results and put them into emails to the survey administrator. I know this is a possible planned future feature, but I need it now and I thought that it seemed simple enough.
Unfortunately, I'm having a hard time deciphering how best to join all the involved tables.
Does anybody have a SQL statement that will return all the questions and answers specified by a given response id?
Once I have the SQL that will do that, the rest will be easy. I'll just have a text file (or maybe a db table) that stores the most recently emailed response id, and the script will compile all the responses with higher rids, and then update text file with the new most recent rid.
The SQL that generates the chart view of responses would be a great place to start, but I haven't been able to finagle that out quite yet.
Thanks for any help.
w
