[Python] Why is it using the wrong value for SQL UPDATE WHERE condition [duplicate]

Discussão em 'Python' iniciado por Stack, Setembro 12, 2025.

  1. Stack

    Stack Membro Participativo

    The line of code

    await bot.db.execute(f'''UPDATE users SET username = {name} WHERE id = {ctx.author.id}''')


    is giving me the error:


    "OperationalError: no such column:"
    ​

    and then the value of the name variable.

    For context this is done in a pycord function and I'm using aiosqlite for my sqlite stuff for async. Why is it seemingly using the name variable to find a column instead of the id provided in front of the WHERE.

    Continue reading...

Compartilhe esta Página