title: How do i array push my tables into one array? php
body: <pre><code>if ($result = mysqli_query($conn, "SELECT O.OrderDate, P.prodID, P.prodName, PO.PurchaseQty FROM Customer C, Orders O, Product P, ProductOrder PO WHERE P.prodID = PO.prodID AND PO.OrderID = O.OrderID AND O.custID = C.custID AND C.custID =  'C1000';")) {
  
  //$response["orderhistory"] = array();
  while ($row = mysqli_fetch_array($result)) {
      // temp user array
      $orderhistory= array();
      $Orders["OrderDate"] = $row["OrderDate"];
      $Product["prodID"] = $row["prodID"];
      $Product["prodName"] = $row["prodName"];
  
  $ProductOrder["PurchaseQty"] = $row["PurchaseQty"];
  
  
       // push single product into final response array
      array_push($response,$Orders,$Product,$ProductOrder);
  }
  
  
  
  // success
  //$response["success"] = 1;
  
  // echoing JSON response
  echo json_encode($response);
  
  /* free result set */
  mysqli_free_result($result);
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>[{"OrderDate":"2015-12-11"},{"prodID":"SF10W","prodName":"Cordless Drill Driver"},{"PurchaseQty":"4"}
  </code></pre>
  
  <p><strong>The output i want :</strong> </p>
  
  <pre><code>"{OrderDate":"2015-12-11",SF10W","prodName":"Cordless Drill Driver","PurchaseQty":"4"}
  </code></pre>
  
  <p>PS:This is my android assignment and there is some function i need to use php function, and i have never study in php before.</p>