我有一个python2.7项目的问题。在
我试图将一个变量设置为从sqlite3数据库检索到的值,但遇到了问题。这是到目前为止我的代码,以及我收到的错误。是的,连接打开得很好,表、列和所指示的行都在那里。在
import sqlite3 import Trailcrest
conn = sqlite3.connect('roster.paw')
c = conn.cursor()
def Lantern(AI):
"""Pulls all of the data for the selected user."""
Trailcrest.FireAutoHelp = c.execute("""select fireautohelp
from roster
where index = ?;""", (AI,) ).fetchall()
错误是:
^{pr2}$
正如thomask在评论中提到的,
index
是一个SQL关键字。可以重命名该列,也可以将其括在反勾中:
相关问题 更多 >
编程相关推荐