http://www.perlmonks.org?node_id=219282


in reply to Quote mark in string messing up mySQL INSERT

Either placeholders or use the quote function in DBI.

I would recode your example thus (completely untested and with no warranty):

sub insertAttribute{ my ($serverID, $featureID, $value) = @_; $_ = $dbh->quote($_) for qw($serverID, $featureID, $value); my $sqlINS = qq{ INSERT INTO attribute VALUES ($serverID, $feature +ID, $value) }; $dbh->do ($sqlINS); }
Remember: $dbh->quote(expression) is your friend.