I am trying to update my history table using the below query:
// update history table
CS50::query("INSERT INTO history (user_id,sold,sold_number,selling_price,date) VALUES(?,?,?,?,NOW() )",$_SESSION["id"],$_POST["symbol"],$selling_stock["shares"],$selling_price["price"]);
but it shows a weird error:
**Fatal error: Unknown column 'user_id' in 'where clause' in /home/ubuntu/workspace/pset7/vendor/library50-php-5/CS50/CS50.php on line 352**
Although a similar query works just fine in buy.php . I also looked at the file specified in the error but there is nothing there. My history table has the following columns: