Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e275d3d4
Commit
e275d3d4
authored
Jun 07, 2006
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mention other placeholders
parent
3b336c7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
Doc/lib/libsqlite3.tex
Doc/lib/libsqlite3.tex
+3
-2
No files found.
Doc/lib/libsqlite3.tex
View file @
e275d3d4
...
@@ -47,10 +47,11 @@ variables. You shouldn't assemble your query using Python's string
...
@@ -47,10 +47,11 @@ variables. You shouldn't assemble your query using Python's string
operations because doing so is insecure; it makes your program
operations because doing so is insecure; it makes your program
vulnerable to an SQL injection attack.
vulnerable to an SQL injection attack.
Instead, use
SQLite
's parameter substitution. Put
\samp
{
?
}
as a
Instead, use
the DB-API
's parameter substitution. Put
\samp
{
?
}
as a
placeholder wherever you want to use a value, and then provide a tuple
placeholder wherever you want to use a value, and then provide a tuple
of values as the second argument to the cursor's
\method
{
execute()
}
of values as the second argument to the cursor's
\method
{
execute()
}
method. For example:
method. (Other database modules may use a different placeholder,
such as
\samp
{
\%
s
}
or
\samp
{
:1
}
.) For example:
\begin{verbatim}
\begin{verbatim}
# Never do this -- insecure!
# Never do this -- insecure!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment