Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

PHP - Getting survey data for plugin

2 years 4 months ago #207699 by deggyorg

I'm trying to extend the CSV output plugin. I need to include details of the limesurvey participant who submitted a response in the CSV file on a formatted line.

My PHP skills are average, but I don't deal with Objects very much.

When I run $this->survey through print_r() I can see [firstname] and [lastname] keys in there that relate to the respondant for the question relating to something that looks like a SQL return as a 'CDbDataReader' object.

I'm stuck in terms of trying to simply access the details of the participant who submitted the response so that I can format them into a string and place them into the CSV output.

I know there must be a simple way, but no amount of stackexchange time or converting data types seems to work for me.


Just me!
The topic has been locked.
2 years 4 months ago - 2 years 4 months ago #207743 by deggyorg
Figured it out - thanks to yiiframework.com/doc/api/1.1/CDbDataReader#current-detail

The way to pull out data is, for example:

Just me!
Last edit: 2 years 4 months ago by deggyorg.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose