We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e6f7a0 commit 3d061a7Copy full SHA for 3d061a7
server/routes.py
@@ -13,13 +13,13 @@ def index():
13
14
if name:
15
cursor.execute(
16
- "SELECT * FROM books WHERE name LIKE '%" + name + "%'"
+ "SELECT * FROM books WHERE name LIKE %s", name
17
)
18
books = [Book(*row) for row in cursor]
19
20
elif author:
21
22
- "SELECT * FROM books WHERE author LIKE '%" + author + "%'"
+ "SELECT * FROM books WHERE author LIKE %s", author
23
24
25
0 commit comments