You have an error in your SQL syntax - pymysql
Думаю ошибка глупая, заранее спасибо за ответ
id = message.from_user.id
skin_name = data_return[1]
price = data_return[0][1:]+"$"
with connection.cursor() as cursor:
insert_query = f'INSERT INTO `user` (id, skin_name, price) VALUES ({id}, {skin_name}, {price});'
cursor.execute(insert_query)
connection.commit()
"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 'кейс #3, 0.96$)' at line 1")
Ответы (1 шт):
Автор решения: anton
→ Ссылка
id_ = message.from_user.id
skin_name = data_return[1]
price = data_return[0][1:] + "$"
with connection.cursor() as cursor:
cursor.execute(insert_query, "INSERT INTO `user` (id, skin_name, price) VALUES (?, ?, ?);", (id_, skin_name, price))
connection.commit()