【发布时间】:2021-02-13 23:52:33
【问题描述】:
我正在用 python3 做一个 sql 基础,我在我的基础上添加了一些人。 我只是有两个人有问题:一个有“'”和一个有“)”
# execut = "INSERT INTO users VALUES(Rafagraph | Notion'Art#0739, 272125469544022027, Rafagraph | Notion'Art, 1, 0, 0, 0, 0.0)"
# cur.execute(execut)
# execut = "INSERT INTO users VALUES ('CmoipastoiB#9926)', '703280156197912736', 'CmoipastoiB-)', 1, 0, 0, 0, 0.0)"
# cur.execute(execut)
我在 print (' \ ' ') 中尝试过,但它不起作用。
谢谢!
【问题讨论】:
-
您应该使用参数化查询 - 例如:stackabuse.com/a-sqlite-tutorial-with-python
标签: python python-3.x sqlite discord.py