使用sqlite3的数据库时,我收到如下错误:
File '..\database.py', line 131, in load_player_abilities
(player.id, ability.id)):
sqlite3.OperationalError: near '=': syntax error
我得到的错误来自以下代码:
for ability in player.abilities:
for level in cursor.execute(
"SELECT level FROM abilities"
"WHERE player_id=? AND ability_id=?",
(player.id, ability.id)):
ability.level = level
答案 0 :(得分:2)
您似乎错过了abilities
和WHERE
之间的空格。
for ability in player.abilities:
for level in cursor.execute(
"SELECT level FROM abilities "
"WHERE player_id=? AND ability_id=?",
(player.id, ability.id)):
ability.level = level