According to PHP documentation, the following is true about the query(INSERT) statement:
For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error.
However, when I run the following version of the statement:
$insert = CS50::query("INSERT INTO portfolios (users_id, symbol, shares) VALUES(?, ?, ?) ON DUPLICATE KEY UPDATE shares = shares + VALUES(shares)", $_SESSION["id"], strtoupper($stock["symbol"]), $_POST["shares"]);
and then var_dump($insert), I get an int (1 or 2), instead of TRUE or FALSE. This makes error-checking impossible.
Does anyone have any idea as to why that is happenning? Everything works fine, it's just the return value that is weird.