filling dropdown with values from MySQL in LS 3.4

More
1 month 1 week ago #165255 by digitaldust
digitaldust created the topic: filling dropdown with values from MySQL in LS 3.4
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?

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #165291 by Joffm
Joffm replied the topic: filling dropdown with values from MySQL in LS 3.4

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.
// 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:
https://www.limesurvey.org/forum/development/114066-typeerror-using-autocomplete

Joffm
The following user(s) said Thank You: digitaldust

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #165309 by digitaldust
digitaldust replied the 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...

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!