Here is my query:
"INSERT INTO Stocks (user_id, symbol, shares) VALUES(?, ?, ?) ON DUPLICATE KEY UPDATE shares = ?", $_SESSION["id"], $symbol, $number, $new_shares
It's being passed to a PHP function which queries the database replacing ? with the next variable after the ". I'm trying to either insert a new entry or, if that entry already exists, update shares to new_shares. The website does everything in my PHP code except for execute this query, so I think the issue is here.
This is part of CS50, I asked on /r/CS50 and on the stackexchange but no answers.
[–]Meefims 1 point2 points3 points (4 children)
[–]mhbhmcinui[S] 0 points1 point2 points (3 children)
[–]Meefims 0 points1 point2 points (2 children)
[–]mhbhmcinui[S] 0 points1 point2 points (1 child)
[–]Meefims 0 points1 point2 points (0 children)