title: Insert many rows from a table into one unique row in another table
body: <p>I have a table named <code>order</code> where there is set a column name <code>list</code></p>
  
  <pre><code>TABLE list
  id |  list      | price    | date
  ---------------------------------------
  1  | Cigar      |  5.00    | 2016-06-30
  2  | Beer       |  6.00    | 2016-06-30
  3  | Whiskey    |  20.00   | 2016-06-30
  4  | Bacon      |  10.00   | 2016-06-30
  </code></pre>
  
  <p>I'd like to insert the <code>list</code> into another table named <code>confirmation</code> in a way that all of them could be in a same row! However, it doesn't work and is inserting in many rows!</p>
  
  <p>The way I want</p>
  
  <pre><code>TABLE confirmation
  id |            theorder             
  --------------------------------
  1  | Cigar, Beer, Whiskey, Bacon
  </code></pre>
  
  <p>The way is showing</p>
  
  <pre><code>TABLE confirmation
  id |  theorder      
  --------------
  1  | Cigar,
  2  | Beer,
  3  | Whiskey,
  4  | Bacon,
  </code></pre>
  
  <p>Here is the code: I'm working with foreach!</p>
  
  <pre><code>$sql     = "SELECT list FROM order";
  $result  = $conn-&gt;query($sql);
  $getList = $result-&gt;fetchAll(PDO::FETCH_ASSOC);
  
  foreach($getOrder as $order) {
    $products = $order['theorder'] . ', ';
    $sql      = "INSERT INTO confirmation (theorder) VALUES ('$products')";
    $result   = $conn-&gt;query($sql);
  }
  </code></pre>