S
S
samperirrrrr2020-12-06 18:14:33
Python
samperirrrrr, 2020-12-06 18:14:33

Error pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; how do I fix it?

how to fix this error? Below is the code. pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'limit=1 WHERE uid=621252537' at line 1")

def abonus(user_id,money):
  connection = connect()
  with connection.cursor() as cursor:
    result = cursor.execute(F'SELECT * FROM accounts WHERE uid={user_id}')
    panos = cursor.fetchone()
    if result == 1:
      panos["limit"] += 1
    cursor.execute(f'UPDATE accounts SET limit={panos["limit"]} WHERE uid={user_id}')
    connection.commit()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-12-06
@samperirrrrr

`limit`=...(reserved word)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question