当我试图从我的数据库(Sqlite3)中删除特定内容时,由于某些原因出现错误:discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: OperationalError: near ",": syntax error
,以下是所需的代码:
c.execute("DELETE FROM accounts WHERE email=?, password=?", (newresults[0], newresults[1]))
顺便提一下,在主代码中定义了新结果[0]和新结果[1]这两个值。
以下是完整的追溯信息:
Ignoring exception in command buy:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 127, in wrapped
ret = await coro(arg)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 911, in _invoke
await self.callback(ctx, **kwargs)
File "C:\Users\user\Desktop\Sidtho\main.py", line 62, in buy
c.execute("DELETE FROM accounts WHERE email=?, password=?", (newresults[0], newresults[1]))
sqlite3.OperationalError: near ",": syntax error
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1008, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 359, in invoke
await injected(ctx)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 135, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: OperationalError: near ",": syntax error
1条答案
按热度按时间5cnsuln71#
您需要使用
AND
,因此: