in reply to Detect SQL injection
DBI does the quoting for you. You should never use sprintf or other string formatting because the likeliness that your quoting is not sufficient is too big. Other people have solved that issue for you decades ago once and forever.
I have to admit this is untested, but it is very likely to work like this.$dbh->do('CREATE TABLE test (a ?, b INT)', undef, $SQL);
If not, have a look at http://search.cpan.org/~timb/DBI-1.613/DBI.pm#quote Or consolidate your SQL driver for quoting functions if you don't use DBI (Dare you!).
Regards
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Detect SQL injection
by JavaFan (Canon) on Aug 10, 2010 at 11:31 UTC | |
|
Re^2: Detect SQL injection
by jeanluca (Deacon) on Aug 10, 2010 at 14:31 UTC |