Welcome to the LimeSurvey Community Forum

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

Displaying database data in a survey

  • Pap123
  • Pap123's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 6 months ago #232565 by Pap123
Displaying database data in a survey was created by Pap123
Please help us help you and fill where relevant:
Your LimeSurvey version:   3.17.8+190722
Own server or LimeSurvey hosting: own server
Survey theme/template: default
==================
Hi, I would like to know if it is possible to add a query for example php to display from a database over a question.
I would like to use a simple SELECT to communicate the highest and lowest value from the database table to the user filling out the survey.

Thanks

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 6 months ago #232566 by tpartner
Replied by tpartner on topic Displaying database data in a survey
You can't use PHP within LimeSurvey. I suggest an AJAX call to an external PHP file that queries the database, either directly or via the API.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
1 year 6 months ago #232691 by bismark

Please Log in to join the conversation.

More
1 year 6 months ago - 1 year 6 months ago #232724 by davebostockgmail
Replied by davebostockgmail on topic Displaying database data in a survey
This may help you .. I used it to query the database and return data into the survey but as Tony says it uses PHP called via Ajax to do it.

[url] forums.limesurvey.org/forum/can-i-do-thi...er-all-needed-solved [/url]
Last edit: 1 year 6 months ago by davebostockgmail. Reason: Added link

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose