Earlier today, I was trying to print out how much cash a user has for portfolio.php. I kept on getting a bunch of errors. I changed my code many times, but could never get rid of the errors I was getting- undefined index, use of undeclared constants, etc. How do you fix the errors and print out how much cash a user has?
To solve this issue, you need 2 variables. Let's call them
query() to get cash value from the row with the id that is contained in
$_SESSION. Then use this line of code to put the cash value into
$cash = $userinfo["cash"];
Then you can put cash in print, and it will print out the user's cash.