(Discord.py) How can I save the ID for a voice channel into an sqlite3 file?

I am trying to make my Discord bot automatically join a voice channel when a user joins it.

To do this, the bot first gets the ID of the server and the voice channel that the user is in, and then saves it to the sqlite3 file.

Below is my code for it:

global conn
global c
conn = sqlite3.connect('test.db')
c = conn.cursor()

async def assign(ctx):
        global getid
        global getguild
        getid = ctx.author.voice.channel.id
        getguild = ctx.author.guild.id
        c.execute ("INSERT INTO channel_data VALUES (getid, getguild, '1')")
        await ctx.send('Channel assigned.')
        await ctx.send('Please join a voice channel first.')

I have created three rows in my sqlite3 file, which are id (string), guild_id (string) and theme (string).

And I have created it using this code:

c.execute("CREATE TABLE channel_data(id STRING, guild_id STRING, theme STRING)")

However, here is what I get:

Ignoring exception in command assign:
Traceback (most recent call last):
  File "C:UserserickAppDataLocalProgramsPythonPython38libsite-packagesdiscordextcommandscore.py", 
line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "c:UserserickPython_VisualStudioCode데이터베이스리타 v2.py", line 55, in assign
    c.execute("INSERT INTO channel_data VALUES (getid, getguild, '1')")
sqlite3.OperationalError: no such column: getid

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:UserserickAppDataLocalProgramsPythonPython38libsite-packagesdiscordextcommandsbot.py", line 939, in invokeine 939, in invoke
    await ctx.command.invoke(ctx)                                                                              line 863, in invoke
  File "C:UserserickAppDataLocalProgramsPythonPython38libsite-packagesdiscordextcommandscore.py", 
line 863, in invoke                                                                                            line 94, in wrapped
    await injected(*ctx.args, **ctx.kwargs)
  File "C:UserserickAppDataLocalProgramsPythonPython38libsite-packagesdiscordextcommandscore.py", getid
line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OperationalError: no such column: 

Please help 🙁


Use proper syntax for insert command.

c.execute("INSERT INTO channel_data (id, guild_id, theme) VALUES (?,?,?)", (getid, getguild, '1'))

You can skip the columns portion (id, guild_id, theme) but verbosity is probably good here.