Welcome to the LimeSurvey Community Forum

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

PHP - Getting survey data for plugin

  • deggyorg
  • deggyorg's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 5 months ago #207699 by deggyorg
PHP - Getting survey data for plugin was created by deggyorg
Hello,

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.

Help!?

Just me!
The topic has been locked.
  • deggyorg
  • deggyorg's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 5 months ago - 3 years 5 months ago #207743 by deggyorg
Replied by deggyorg on topic PHP - Getting survey data for plugin
Figured it out - thanks to yiiframework.com/doc/api/1.1/CDbDataReader#current-detail


The way to pull out data is, for example:
Code:
this->survey->responses->current()['lastname']

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

Lime-years ahead

Online-surveys for every purse and purpose