in reply to Re^5: DBI do() SQL injection
in thread DBI do() SQL injection
You can always fix that by wrapping the value into a quoteAnd is there any advantage to using quote instead of placeholders?
There are a few places (table and column names, mostly) where you're required to use quote instead of placeholders, but, IMO, you should always use placeholders for data values where possible and never rely on quoting unless you absolutely have to.sub run_do_with_placeholders($dbh, $id, $name) { $dbh->do(qq{ INSERT INTO customers (id,name) VALUES(?, ?)}, undef, $id, $name); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: DBI do() SQL injection
by choroba (Cardinal) on Oct 20, 2023 at 17:38 UTC | |
by dsheroh (Monsignor) on Oct 21, 2023 at 11:21 UTC |