Home > Back-end >  why this error "TypeError: execute expected at most 2 arguments, got 3"?
why this error "TypeError: execute expected at most 2 arguments, got 3"?

Time:03-13

c.execute("INSERT INTO users (username, password) VALUES (?, ?)", username, password)

as a beginner, I am trying to make a sign up form for my first web app using Flask and python.

CodePudding user response:

Instead of using different arguments for each variable, you need to put all variables in an array or a tuple:

c.execute("INSERT INTO users (username, password) VALUES (?, ?)", (username, password) )
  • Related