Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Connect to mysql table in Perl

Hi,
I'd like to know how to connect in Perl to a mysql database to check for a value entered in a survey against database values.
In Unveriefied Perl  I have VALUE("Accesscode") which has been entered in the survey.
I have set up a simple mysql test database with
host: mysql5.my-gadget.com
db name: db342250_4
db user: db342250_4
password: sawtoothtest
table: Test
fields: ID (autoincrement), Code (Varchar)

What would be the Perl code to check if VALUE("Accesscode") matches with any value in "Code"?

I know, this goes far beyond the usual stuff, but if anybody could help, that would be great.
Thanks, Thomas
asked Mar 9, 2012 by thagel (255 points)
retagged Sep 1, 2016 by Walter Williams

1 Answer

+2 votes
You can use the SSI Script function GetValue which will return any value in the database and SetValue to change any value in the database.  If the database is external  Please see

https://sawtoothsoftware.com/forum/836/redirecting-incomplete-status-and-respondent-number

for code on how to connect to the database.
answered Mar 9, 2012 by Mike Lodder Gold (23,410 points)
...