This is the code I have at the moment
dbshares = db.execute("SELECT :shares FROM portfolio WHERE user_id = :user_id", shares=shares, user_id=session["user_id"])
if dbshares[0]['shares'] - shares < 0:
return apology("you sell shares you don't have")
I believe the middle line is giving me trouble, and I'm not sure how it needs to be. I have tried all of the following
dbshares[0]-shares...
int(dbshares)-shares...
int(dbshares[0])-shares...
int(str(dbshares))-shares...
and such. If someone could help me out with what this is supposed to look like it would be appreciated, thanks!