I can't find my mistake for a few hours already, and I keep getting the same error:
Fatal error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' Users_id = '11'' at line 1 in /home/ubuntu/workspace/pset7/vendor/library50-php-5/CS50/CS50.php on line 352
Here is the line of code it is related to:
CS50::query("SELECT * FROM Portfolios WHERE Symbol = ?, Users_id = ?", $entered_symbol, $_SESSION["id"])
Here is the whole piece:
$entered_symbol = $_POST["symbol"];
if(.....)
......
// see if you own such stock
else if (CS50::query("SELECT * FROM Portfolios WHERE Symbol = ?, Users_id = ?", $entered_symbol, $_SESSION["id"]) < 1)
{
apologize("You don't own such stock");
}
Almost the same error here:
CS50::query("DELETE FROM Portfolios WHERE Users_id = ?, Symbol = ?", $_SESSION["id"], $entered_symbol);
Fatal error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' Symbol = 'HON'' at line 1 in /home/ubuntu/workspace/pset7/vendor/library50-php-5/CS50/CS50.php on line 352
Thank you very much!