'TypeError: execute expected at most 2 arguments, got 5
i dont understand what this error means could anyone please help me i will attach the piece of code down below
else:
cursor.execute("INSERT INTO 'Users' (Firstname, Lastname, Username, Password) VALUES (?, ?, ?, ?)", str(Firstname.get()), str(Lastname.get()), str(Username.get()), str(Password.get(),))
Solution 1:[1]
The parameter values need to be in a single argument, not separate arguments.
cursor.execute("INSERT INTO 'Users' (Firstname, Lastname, Username, Password) VALUES (?, ?, ?, ?)",
(Firstname.get(), Lastname.get(), Username.get(), Password.get()))
There's also no need to call str(), as Entry.get() returns a string.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Barmar |
