in reply to Quote mark in string messing up mySQL INSERT
I would recode your example thus (completely untested and with no warranty):
Remember: $dbh->quote(expression) is your friend.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); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Quote mark in string messing up mySQL INSERT
by shoez (Sexton) on Dec 13, 2002 at 00:23 UTC | |
by Cmdr_Tofu (Scribe) on Dec 13, 2002 at 04:10 UTC | |
by htoug (Deacon) on Dec 13, 2002 at 08:24 UTC |