So I think I know where the problem is, it's trying to update the variable shares taken from the form, and add the shares from the form and the new amount of shares, which is not helpful. I need to grab the value of shares from the database of the user, so how do I do that? I just don't know how to grab the variable from the database. Help would be appreciated!
db.execute("UPDATE portfolio\ SET :shares = :shares + :newshares\ WHERE :user_id AND :stock IN Portfolio", user_id=session["user_id"], stock=stock["symbol"], shares = shares, newshares = newshares)