in reply to Database Insert Depending on Data Type
No, please don't do that. Either use the $dbh->quote() method, or even better use placeholders. Use placeholders! Did I mention? Use placeholders - more secure, more portable, the right way to do it. Both quote() and placeholders automatically quote strings and leave numbers unquoted.
my $sth = $dbh->prepare(" UPDATE tablename SET columname = ? "); $sth->execute($data);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Database Insert Depending on Data Type
by Olaf (Acolyte) on Dec 20, 2007 at 20:45 UTC | |
by jZed (Prior) on Dec 20, 2007 at 21:12 UTC |
In Section
Seekers of Perl Wisdom