0

When using sqlite3's database, I get an error like so:

    File '..\database.py', line 131, in load_player_abilities
      (player.id, ability.id)):

sqlite3.OperationalError: near '=': syntax error

The error I'm getting is coming from the following piece of code:

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

1 Answer 1

2

It seems you are missing a space between abilities and 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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.