I am trying to get the code to work and am not worrying about sql injections yet.
Code from Buy function
current_cash = db.execute("SELECT cash FROM users WHERE id=current_id")
I asked a similar question here and did not get an answer. The post below contains code from login function.
https://www.reddit.com/r/cs50/comments/bm9rq7/does_sessionuser_id_carry_over_from_the_login_and/
The main error in the image below is caused by
session["user_id"] = username_list_check[0]["id"]
in the register function. Why is that?
Below contains the error message
Below contains register function in application.py Could you tell me what is wrong with register function?
Just for clarity I will add login, not that I think I changed anything but you never know.
Do I need to post the entire code from the buy function?
To summarize my questions, why doesn't current_username work? Does my psuedocode in the example from reddit work in the link?
Thanks for the help.