回答編集履歴
2
test
CHANGED
@@ -11,4 +11,6 @@
|
|
11
11
|
)""", (x,))
|
12
12
|
```
|
13
13
|
|
14
|
+
参照:
|
15
|
+
https://mysqlclient.readthedocs.io/user_guide.html#some-examples
|
14
|
-
|
16
|
+
https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursor-execute.html
|
1
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
SQL文にプレースホ
|
1
|
+
SQL文にプレースホルダを設定し、タプルで渡します。
|
2
2
|
```py
|
3
3
|
(略)
|
4
4
|
cursor.execute("DROP TABLE IF EXISTS %s", (x,))
|