I'm trying to add a row into my finance db using the code below (a few versions), but keeping getting an error saying I'm passing in too many variables to the execute() function. Any direction here would be great.
username = request.form['username'] #hash the password password = generate_password_hash(request.form['password']) #Execute sql to add value into db # Add to database by creating a row with :username, :password (hash) db.execute('''INSERT INTO users VALUES(?,?)''', (username, password))
db.execute('''INSERT INTO users(username, password) VALUES(?,?)''', (username, password))
db.execute("INSERT INTO users (username, hash) VALUES (:username, :hash)", username, password)
"execute() takes 2 positional arguments but 3 were given"