I have several pieces of data collected from a form I want to enter into my database. However, one of those data pieces is a list created from how many checkboxes a user has pressed. When I try and insert this into a list I get the error "sqlite3.InterfaceError: Error binding parameter 4 - probably unsupported type.". My code stops working at "cur.execute(sql, listing).
I've tried changing the type of data piece it is, but I need the tuple to stay as it is. I have tried to use cur.executemany but it didn't work.
title = request.form['item_name']
platform = request.form.getlist('platform_list[]')
con = create_connection(DATABASE_NAME)
listing = (title, platform)
sql = """INSERT INTO items(id, title, platform) VALUES (NULL,?,?);"""
cur = con.cursor()
cur.execute(sql, listing)
con.commit()
con.close()