Welcome to the LimeSurvey Community Forum

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

filling dropdown with values from MySQL in LS 3.4

  • digitaldust
  • digitaldust's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #165255 by digitaldust
I am on Limesurvey 3.4 and Mac OSX, and I have created a new database in the same MySQL where LimeSurvey is running (bitnami install on AWS).

Much in the spirit of this article 3. Input from a MySQL database (trickiest, but also the most versatile and secure). , I'd like to connect to my database and retrieve values to be displayed in a dropdown, but I am not sure if the article still applies to versions >3.

Plus, I don't understand from the article in what folder do I have to put the php files. Can anyone share some insights?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago #165291 by Joffm

I don't understand from the article in what folder do I have to put the php files

Here in the code you see it.
You can set the include path to the folder where you saved your files, without the setting of the include path just enter the correct folder into the "require_once"-statement.
Code:
// Include files outside of webroot
set_include_path('/var/www/surveys/test-survey');
 
// Fetch database credentials
require_once ('constant.php');
 
// Connect to database and perform query
require_once ('database.php');

But there is one thing to remember:
Jquery UI is not included in the templates anymore.
See here:
www.limesurvey.org/forum/development/114...r-using-autocomplete

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: digitaldust
The topic has been locked.
  • digitaldust
  • digitaldust's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #165309 by digitaldust
Replied by digitaldust on topic filling dropdown with values from MySQL in LS 3.4
thank you for your message, actually it's me also in the thread you linked...

I realize it's super tricky to install jquery-ui...
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose