in reply to Reliability of quoting via DBI placeholders
For all other items (for which a type is provided), it looks up the type to see if it needs quoting. If so, it slaps a single quote around it. Any single quotes (or whatever the appropriate literal prefix for that data type) found in the string are doubled.DBI::SQL_INTEGER DBI::SQL_SMALLINT DBI::SQL_DECIMAL DBI::SQL_FLOAT DBI::SQL_REAL DBI::SQL_DOUBLE DBI::SQL_NUMERIC
That's also done if there's no type provided.
I've always found this to be more valuable because it helps avoid some malicious statements -- a user will have more trouble trying to drop one of my tables if his '; DROP TABLE users;' statement is quoted and treated as a literal string.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Reliability of quoting via DBI placeholders
by princepawn (Parson) on Aug 21, 2000 at 22:09 UTC |