title: How to store array values in a MySQL database
body: <p>I don't know how to store my array data in database, I only know fetching and displaying data. Any suggestion or discrimination is ok to me because i didn't get the logic and im a noob and newbie</p>
  
  <pre><code>    &lt;?php
      $cart_statement = "SELECT * FROM user_cart WHERE email = '$email'";
      $cart_res = mysqli_query($con,$cart_statement);
      $storeArray = Array();
      $cart_num = mysqli_num_rows($cart_res);
      while ($cart_row = mysqli_fetch_array($cart_res)) {
          echo $storeArray[] =  $cart_row['product_name'].",";
      }
      ?&gt;
  </code></pre>
  
  <p>mysql table user_cart</p>
  
  <p>|- - - - - - |- - - - - - - - - - - -|<br>
  |  cart_id   | product_name  |<br>
  | - - - - - -|- - - - - - - - - - - -|<br>
  |- - -1 - - |- - -Laptop1 - - - |<br>
  |- - -2 - - |- - -Laptop2 - - - |<br>
  |- - - - - - |- - - - - - - - - - - -|        </p>
  
  <p>output i want is Laptop1,Laptop2</p>
  
  <p>store in tbl_orders</p>
  
  <p>|- - - - - - - |- - - - - - - - - - - - - - - |<br>
  |  order_id   | - - - products - - - - -  |<br>
  | - - - - - - -|- - - - - - - - - - - - - - - |<br>
  |- - -1 - - - |- Laptop1, Laptop2  - |<br>
  |- - - - - -  - |- - - - - - - - - - - - - - - |        </p>
  
  <p>sorry i dont know how to make tables here </p>