This is weird ... obviously I am missing something very obvious, but here goes got the sell for done and it feeds in with the symbol to sell. Need to determine if the stock is owned. Easy, right..
// query holdings for stock
$position = CS50::query("SELECT shares FROM holdings WHERE user_id = ? AND symbol = ?",$_SESSION["user"], $_POST["symbol"]);
if ($position == false);
{
dump($position);
apologize("You do not own that stock.");
}
Well, it dumps:
Array
(
[0] => Array
(
[shares] => 222
)
)
So, obviously NOT empty....BTW a non- owned stock gives:
Array
()
I've spent a day on this..... suggestions? Oh, and using === in the if statement provides the same result.
Eternal gratitude for the one who solves this...