1
vote
CS50 finance SELL - Cannot get the code to subtract the stock from the database or index
This shares = request.form.get("shares") creates shares as a string. -1 * shares returns '', because of the python "string multiplication" feature. Cast it to an int, as has been ...
1
vote
Accepted
Finance pset, register will not insert user data
Have you looked at the flask log (in the console where you flask run). I'd expect it to be giving an error hereabouts:
new_user = db.execute("INSERT INTO users ('username', 'hash') VALUES (:username, ...
1
vote
Accepted
Finance PSET8: Error: execute() takes 2 positional arguments but 3 were given
The VALUES and parameters are switched up.
The VALUES clause should be VALUES (:username,:password)
The parameters would be username = username, password = password.
1
vote
Accepted
Update on duplicate portflolio help
INSERT .... ON DUPLICATE KEY UPDATE....
ON DUPLICATE is a clause attached to an insert statement.
For more, google "ON DUPLICATE KEY in sql"
If this answers your question, please click on the check ...
Only top scored, non community-wiki answers of a minimum length are eligible