Output of button does not displayed

I want to output the data and also the buttons in my php codes. But i do not know why the buttons does not output as coded. Can anyone let me know where did my codes go wrong? I’ve been searching it but i cant’t find the problem. Thanks in advance.

    <?php
   if(isset($_POST['invoice_details'])) {
          $discountsql = "INSERT INTO `invoice_price` (`order_id`) VALUES ('.$order_id.') ";
          $conn->query($discountsql);
        }
        ?>
         <?php
          $sql2 = " SELECT order_id FROM ordered_items GROUP BY order_id WHERE order_id = '".$row[order_id]."'  ";
                      $query2 = $conn -> query($sql2);
                      while ($row2 = $query2 -> fetch_assoc()) {
        
        ?>
        
    <div class="col-12 form-group">
         <p> <?php echo $row2['order_id']; ?></p>
        <p class="text-success"  pointer-events="none" style="font-weight: bold; font-size: 25px; text-align:center;  ">Your order is confirmed !</p>
      <a href="order-list.php">
        <input class="btn btn-block checkoutbtn" type="button" name="invoice_details"  value="Go to Order Page">
      </a>
    </div>
     <?php
                      }
        
        ?>

Well, Sasha, the code you posted must be just small parts of the over all PHP page.

In your code you show us one button and code to insert based on some value named order_id.
But, you do not show any input field for this item. And, in between these, you show a SELECT query.
I think you need to explain more to make sense of this. At least explain where the insert data comes from.

Sponsor our Newsletter | Privacy Policy | Terms of Service