- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Return Data from External Database
- thomsol
- Topic Author
- Offline
- New Member
Less
More
11 years 1 month ago #92080
by thomsol
Return Data from External Database was created by thomsol
I want to have a lookup against an external database to retrieve information based on a survey response. For example: user enters vehicle identification #, I want to look up the make, model, year, etc.
The way I'm attempting to do this is by adding a function to the em_core_helper.php module, which contains the logic to connect to the database, then look up the information.
Question, can the return from this function be a name->value pair, such that I could reference it as {car_id(qCarId.shown)["Model"]} or [car_id[CarId.shown)->Model?
Open to ideas of another way to do this....
(This question was moved from installation category)
The way I'm attempting to do this is by adding a function to the em_core_helper.php module, which contains the logic to connect to the database, then look up the information.
Question, can the return from this function be a name->value pair, such that I could reference it as {car_id(qCarId.shown)["Model"]} or [car_id[CarId.shown)->Model?
Open to ideas of another way to do this....
(This question was moved from installation category)
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
11 years 1 month ago #92086
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Return Data from External Database
Rather than modifying the core code, it may be easier/safer to make an AJAX call to a remote script that accesses the "cars" DB for you.
Alternatively, here's an example of how to access data from a remote CSV file - www.limesurvey.org/en/forum/design-issue...filled-questions-csv
Alternatively, here's an example of how to access data from a remote CSV file - www.limesurvey.org/en/forum/design-issue...filled-questions-csv
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- thomsol
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
11 years 1 month ago #92091
by thomsol
Replied by thomsol on topic Return Data from External Database
Ajax... ugh!! (sorry, not my skillset)... Any chance this will be handled with the plug-ins due in 2.1?
The topic has been locked.