Welcome to the LimeSurvey Community Forum

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

Autocomplete with PHP/MS SQL

  • FredJackson
  • FredJackson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 months 2 weeks ago #265277 by FredJackson
Autocomplete with PHP/MS SQL was created by FredJackson
Please help us help you and fill where relevant:
LimeSurvey version: LimeSurvey Community Edition Version 6.5.9+240521 
Own server or LimeSurvey Cloud: Own
Survey theme/template:
==================
(Write here your question/remark)

Hi, a little new to this and maybe a little over my head! But cannot work out the scripts in the workaround;
www.limesurvey.org/manual/Workarounds:_M...r_LimeSurvey_2.05.2B

Using Option 3 "Input from a MySQL database (trickiest, but also the most versatile and secure)"

The part that is throwing me "term" within the query part. On the MS SQL db, I have a table called "employee" and column called "email" I want to pull out all of the data from here (around 20,000 records) so do I need the LIKE :term?

As this script is for MySQL are there differring commands for the MS SQL?
 

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
6 months 2 weeks ago #265279 by DenisChenu
Replied by DenisChenu on topic Autocomplete with PHP/MS SQL
There are some difference between MySQL and MS SQL.
But clearly : it's out of this forum to teach SQL …

You srill need to use PDO then somethng like "email LIKE :term "

Else you can have a look to gitlab.com/SondagesPro/QuestionSettingsT...tQuestionByResponses

Something ready to go and using a survey to manage a table of data for autocomplete

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

  • FredJackson
  • FredJackson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 months 1 week ago #265911 by FredJackson
Replied by FredJackson on topic Autocomplete with PHP/MS SQL
Thank you for this, but still at a loss.

The guide in the manual just does not work, appreciate this talks about MySQL and not Microsoft SQL Server but thought it would be similar!

www.limesurvey.org/manual/Workarounds:_M...r_LimeSurvey_2.05.2B

I need to lookup a db and table to autocomplete as I have over 20,0000 sensitive email addresses that cannot be done via CSV which would be easily accessible via DevTools for example in plain text.

A simpler guide would be great, where exactly to put PHP files and any additonal JS that needs to run .. or a Plugin ;)

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
5 months 1 week ago #265916 by DenisChenu
Replied by DenisChenu on topic Autocomplete with PHP/MS SQL

A simpler guide would be great, where exactly to put PHP files and any additonal JS that needs to run .. or a Plugin ;)
 


Did you look at my message ?

Else you can have a look to gitlab.com/SondagesPro/QuestionSettingsT...tQuestionByResponses


Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

  • FredJackson
  • FredJackson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 months 1 week ago #265923 by FredJackson
Replied by FredJackson on topic Autocomplete with PHP/MS SQL
I have tried to use your plugin (going to fudge it within the db) however get this in the dev tools;

Uncaught TypeError: $(...).select2 is not a function
at SelectQuestionByResponses (selectquestionbyresponses.js:16:39)
at 823586?newtest=Y&lang=en:631:1

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
5 months 1 week ago #265924 by DenisChenu
Replied by DenisChenu on topic Autocomplete with PHP/MS SQL
Maybe need to add this for 6.X : gitlab.com/SondagesPro/coreAndTools/select2package


> going to fudge it within the db

? What do you mean ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose