in reply to text entry into mysql using perl
Two: use placeholders:my $sql = $dbh->quote($foo); $dbh->do($sql);
I prefer option two. Read <code>perldoc DBI</code for more info on placeholders.my $sth = $dbh->prepare("INSERT INTO foo (bar, baz, quux) VALUES (?, ? +, ?)"); $sth->execute($bar, $baz, $quux);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (ar0n: use placeholders) Re: text entry into mysql using perl
by cdherold (Monk) on Apr 16, 2001 at 05:45 UTC | |
by ar0n (Priest) on Apr 16, 2001 at 05:50 UTC |