For example, I want to create a function where I add a user to my 'users' table:
def add_user(name, id):
cursor.execute("INSERT INTO users VALUES (?, ?, ?)", (name, id))
conn.commit()
(It should be noted that the 'name' column (not the variable) is the first column, and the 'id' column is the third column)
This code writes the 'name' variable to the first column, which is the name column, and writes the 'id' variable to the second column (which is not the id column).
Is there a way I can use the names of the columns to specify what to write to? I want to avoid using solutions like writing the current value of the second column to itself, or adding 0 to it, or something like that.