title: Why is this PHP page completely blank?
body: <p>I have a shopping cart and I want to send the purchase to my database. I am completely sure that the form part works fine, however the page where the purchase needs to be inserted into the database is wrong. However, I don't really know what's wrong and why it's giving me just a blank page (addorder.php, the processing page) while it's supposed to give me an error message on the previous page. This is the code for addorder.php:</p>
  
  <pre><code>&lt;?php
  
  class PurchaseOrder
  {
      private $db_connection = null;
  
      public $errors = array();
  
      public $messages = array();
  
      public function __construct()
      {
          if (isset($_POST["purchase"])) {
              $this-&gt;addOrder();
          }
      }
  
      private function addOrder()
      {
          if (empty($_POST['order_firstname'])) {
              $this-&gt;errors[] = "Please fill in your first name.";
          } elseif (empty($_POST['order_lastname'])) {
              $this-&gt;errors[] = "Please fill in your last name."; 
          } elseif (empty($_POST['order_phone'])) {
              $this-&gt;errors[] = "Please fill in your phone number.";  
          } elseif (empty($_POST['order_address'])) {
              $this-&gt;errors[] = "Please fill in your address.";
          } elseif (empty($_POST['order_city'])) {
              $this-&gt;errors[] = "Please fill in your city.";  
          } elseif (empty($_POST['order_postalcode'])) {
              $this-&gt;errors[] = "Please fill in your postal code.";
          } elseif (empty($_POST['order_deliverydate'])) {
              $this-&gt;errors[] = "Please fill in a delivery date you like.";               
          } elseif (empty($_POST['order_country'])) {
              $this-&gt;errors[] = "Please choose your country.";
  
              $this-&gt;db_connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
  
              if (!$this-&gt;db_connection-&gt;set_charset("utf8")) {
                  $this-&gt;errors[] = $this-&gt;db_connection-&gt;error;
              }
  
              if (!$this-&gt;db_connection-&gt;connect_errno) {
  
                  $lastorder= "SELECT orderNumber FROM orders ORDER BY orderNumber DESC LIMIT 1";
                  $lastordernumber=mysql_query($lastorder);
  
                  while ($row=mysql_fetch_array($lastordernumber)) {
                      $lastnumber = $row['orderNumber'];
                  }
  
                  $order_firstname = $_POST['order_firstname'];
                  $order_lastname = $_POST['order_lastname'];
                  $order_phone = $_POST['order_phone'];
                  $order_address = $_POST['order_address'];
                  $order_city = $_POST['order_city'];
                  $order_postalcode = $_POST['order_postalcode'];
                  $order_deliverydate = $_POST['order_deliverydate'];
                  $order_country = $_POST['order_country'];
                  $order_date = date("Y-m-d");
  
                  $customernumber = $_SESSION['CustomerNumber'];
  
                      $sql = "INSERT INTO orders (orderNumber, orderDate, requiredDate, shippedDate, status, comments, customerNumber) VALUES('" . $lastnumber . "', '" . $order_date . "', null, null, null, null, '" . $customernumber . "');";
  
                      $query_new_order = $this-&gt;db_connection-&gt;query($sql);
  
                      if ($query_new_order) {
                          $this-&gt;messages[] = "Your profile has been updated succesfully!";
                      } else {
                          $this-&gt;errors[] = "Sorry, your registration failed. Please go back and try again.";
                      }
              } else {
                  $this-&gt;errors[] = "Sorry, no database connection.";
              }
          } else {
              $this-&gt;errors[] = "An unknown error occurred.";
          }
      }
  }
  </code></pre>
  
  <p>And this is a picture of the 'orders' table in my database:
  <img src="https://i.stack.imgur.com/X6LRL.png" alt="enter image description here"></p>
  
  <p>Can you guys help me out, I debugged the code and there are no syntax errors. What can it be? I am pretty confused now...</p>
  
  <p>EDIT: This is how messages and errors are displayed on the sendviaparcel.php page, which is also the page with the form on it:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  if (isset($purchaseOrder)) {
      if ($purchaseOrder-&gt;errors) {
          foreach ($purchaseOrder-&gt;errors as $error) {
              echo '&lt;div class="well"&gt;&lt;h4&gt;&lt;i class="fa fa-exclamation-triangle fa-3"&gt;&lt;/i&gt; '.$error.'&lt;/h4&gt;&lt;/div&gt;';
          }
      }
      if ($purchaseOrder-&gt;messages) {
          foreach ($purchaseOrder-&gt;messages as $message) {
              echo '&lt;div class="well"&gt;&lt;h4&gt;&lt;i class="fa fa-check fa-3"&gt;&lt;/i&gt; '.$message.'&lt;/h4&gt;&lt;/div&gt;';
          }
      }
  }
    
   require("includes/connection.php");
   
  ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And this is the form on sendviaparcel.php:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form method="post" action="addorder.php" name="orderform"&gt;
    &lt;table class="table table-striped"&gt;
                          &lt;---THIS IS MY TABLE CONTENT---/&gt;
    &lt;/table&gt;
   &lt;a href="index.php" class="btn btn-login"&gt;Cancel &lt;i class="fa fa-times fa-2"&gt;&lt;/i&gt;&lt;/a&gt;
   &lt;button type="submit" class="btn btn-login btn-signin" name="purchase"&gt;Confirm purchase &lt;i class="fa fa-check fa-2"&gt;&lt;/i&gt;&lt;/button&gt;
  &lt;/div&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have already turned on error reporting, but it returns nothing.</p>