SilverBean
Programmer
I ran into a surprising last minute problem here. Not sure if there is anything Perl/CGI can do for me or if I should be looking on the MySQL side of things.
You guessed it I've got a Perl/CGI script adding, updating a MySQL database.
My adds are fine I use a join thing and push data into a field array or value array such as:
push @fields, "username";
push @fields, "password";
push @fields, "email";
push @values, $db->quote($in{'username'});
push @values, $db->quote($in{'password'});
push @values, $db->quote($in{'email'});
$myjoin="insert into tblusernames (" . join (', ', @fields) . ") values (" . join (', ',@values) . ")";
My Updates seem to be working fine. This is a typical string that I use:
$myjoin="update tblusernames set security='$security', approved='$approved' where userid='$userid' ";
The one pesky problem I'm runing into is when the data contains double quotes(") and single quotes (') and its only during updates.
The add continues to work fine but the updates gives an error and the update is not made.
Any suggestions about how to overcome this? I probably would have to live with this as a fundamental problem and maybe do a replace in Perl for these. However the Add seems to be fine with these. So it makes me think there is something on the Perl Side I could do.
You guessed it I've got a Perl/CGI script adding, updating a MySQL database.
My adds are fine I use a join thing and push data into a field array or value array such as:
push @fields, "username";
push @fields, "password";
push @fields, "email";
push @values, $db->quote($in{'username'});
push @values, $db->quote($in{'password'});
push @values, $db->quote($in{'email'});
$myjoin="insert into tblusernames (" . join (', ', @fields) . ") values (" . join (', ',@values) . ")";
My Updates seem to be working fine. This is a typical string that I use:
$myjoin="update tblusernames set security='$security', approved='$approved' where userid='$userid' ";
The one pesky problem I'm runing into is when the data contains double quotes(") and single quotes (') and its only during updates.
The add continues to work fine but the updates gives an error and the update is not made.
Any suggestions about how to overcome this? I probably would have to live with this as a fundamental problem and maybe do a replace in Perl for these. However the Add seems to be fine with these. So it makes me think there is something on the Perl Side I could do.