I have some trouble with the insertion into the database table in the buy section. I get a KeyError: "id". This is my code:
result = db.execute("INSERT INTO transactions (id, symbol, price, shares, date) VALUES(:username, :symbol, :price, :shares, :date)",
id = session['user_id'],
symbol = request.form.get("symbol"),
price = price,
shares = request.form.get("shares"),
date = datetime.datetime.now())
This is the error https://ibb.co/g00dFV This is my table https://ibb.co/jitn9q
Thanks