My sell.php file renders sell_form.php but when I submit some stock symbol I don't get anything but reload of the same file. I can't figure out why. Can someone help me with this?
// Code deleted
And sell_form.php looks like:
// Code deleted
This is the only code that will execute.
require("../includes/config.php");
$rows = CS50::query("SELECT id FROM portfolios WHERE user_id = ?", $_SESSION["id"]);
if ($rows == false)
{
apologize("You don't have any stocks to sell.");
}
else
{
render("sell_form.php", ["title" => "Sell"]);
When the program takes the else branch, it renders sell_form.php. It will never execute the rest of the code.