I know there are a lot of questions about this on SO but none of them helped me. I am trying to follow along in the CS50 lecture 9 using sqlite3 instead of their SQL library but keep getting the error: sqlite3.ProgrammingError: Incorrect number of bindings supplied. regarding the following line of code:
books = cursor.execute("SELECT * FROM books WHERE id IN (?)", session["cart"])
No matter how I format it I can't get it to work. I have tried using a list, a tuple, a and all combinations of those two as well as a tuple of tuples and a list of lists. Nothing works. I have tried using executemany as well but that didn't work either.
The table books has only the id and name of the book with the id being primary, session["cart"] is a list which in this case happened to be: ['1', '1', '2', '2', '4', '2', '5', '7', '6', '3', '4', '4']