In pset7, I have had a lot of problems regarding the undefined index error. I have been able to fix all of them except this one, and trying to fix it has been making me wonder what that error is. Could you explain what "undefined index" is and what I could do to fix this error in sell.php?
I am getting an undefined index error On my sell.php template on line 10 for "symbol":
$rows = query("SELECT * FROM Stock WHERE id = ?", $_SESSION["id"]);
$stocks[]= [];
foreach ($rows as $row)
{
$stocks[] = ["symbol" => $row["symbol"],
"shares" => $row["shares"]
];
}