title: Display check out detail group by Vendors Name
body: <p>When I added (Random added) product to cart by different Vendors.</p>
  
  <p>Ex :</p>
  
  <p>Data Tables.</p>
  
  <pre><code>VENDORS TABLE
  | vendorid | vendorname |
  -------------------------
  |     1    |     A      |
  |     2    |     B      |
  |     3    |     C      |
  -------------------------
  PRODUCTS TABLE
  | productid | productname | postbyvendor(FK) |
  ----------------------------------------------
  |     1     |   Shirt1    |        1         |
  |     2     |   Shirt2    |        1         |
  |     3     |   Shirt3    |        2         |
  |     4     |   Shirt4    |        2         |
  |     5     |   Pants1    |        1         |
  |     6     |   Pants2    |        3         |
  </code></pre>
  
  <p>Clicked add to Cart for 6 times.</p>
  
  <pre><code>1st Add Shirt1 from Vendor A to cart
  2nd Add Shirt3 from Vendor B to cart
  3rd Add Pants2 from Vendor C to cart
  4th Add Shirt2 from Vendor A to cart
  5th Add Pants1 from Vendor A to cart
  6th Add Shirt4 from Vendor B to cart
  </code></pre>
  
  <p>Cart view displayed like this.</p>
  
  <pre><code>&lt;li&gt;Shirt1&lt;/li&gt;
  &lt;li&gt;Shirt3&lt;/li&gt;
  &lt;li&gt;Pants2&lt;/li&gt;
  &lt;li&gt;Shirt2&lt;/li&gt;
  &lt;li&gt;Pants1&lt;/li&gt;
  &lt;li&gt;Shirt4&lt;/li&gt;
  </code></pre>
  
  <p>I want to display check out detail like this.</p>
  
  <pre><code>&lt;li&gt;Vendor Name : A&lt;/li&gt;
  &lt;li&gt;Shirt1&lt;/li&gt;
  &lt;li&gt;Shirt2&lt;/li&gt;
  &lt;li&gt;Pants1&lt;/li&gt;
  &lt;li&gt;Vendor Name : B&lt;/li&gt;
  &lt;li&gt;Shirt3&lt;/li&gt;
  &lt;li&gt;Shirt4&lt;/li&gt;
  &lt;li&gt;Vendor Name : C&lt;/li&gt;
  &lt;li&gt;Pants2&lt;/li&gt;
  </code></pre>
  
  <p>My query.</p>
  
  <pre><code>$statement = $mysqli_conn-&gt;prepare("SELECT productname, postbyvendor FROM products_tbl WHERE productname = ? order by postbyvendor asc");
  </code></pre>
  
  <p>Code that i've tried.</p>
  
  <pre><code>    foreach($_SESSION["products"] as $product){
      $product_name = $product["productname"];
      $vendorsid = $product["postbyvendor"];
  
      $cart_box = "&lt;li&gt;$vendorsid $product_name&lt;/li&gt;";
  }
  </code></pre>
  
  <p>Displayed like :</p>
  
  <pre><code>&lt;li&gt;1 Shirt1&lt;/li&gt;
  &lt;li&gt;2 Shirt3&lt;/li&gt;
  &lt;li&gt;3 Pants2&lt;/li&gt;
  &lt;li&gt;1 Shirt2&lt;/li&gt;
  &lt;li&gt;1 Pants1&lt;/li&gt;
  &lt;li&gt;2 Shirt4&lt;/li&gt;
  </code></pre>
  
  <p>Appreciated.</p>