title: Insert array values into mysql database
body: <p>The variables are being posted from a previous page through array values.
  when I print_r($values) I get the whole value on this array including the numerical values of the array ex: array[0], array[1] ..etc.
  Please can some tell me what I am doing wrong. the implode function was not used because the values are passed from a cart page though session variables.</p>
  
  <p>First part of code below:</p>
  
  <pre><code>&lt;?php
      $current_url = base64_encode($url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
      if(isset($_SESSION["products"]))
      {
          $total = 0;
          echo '&lt;form method="post" action="process.php"&gt;';
          echo '&lt;ul&gt;';
          $cart_items = 0;
          foreach ($_SESSION["products"] as $cart_itm)
          {
             $product_code = $cart_itm["code"];
             $results = $mysqli-&gt;query("SELECT Title,Description,Price FROM main_menu WHERE MenuID='$product_code' LIMIT 1");
             $obj = $results-&gt;fetch_object();
  
              echo '&lt;li class="cart-itm"&gt;';
              echo '&lt;span class="remove-itm"&gt;&lt;a href="model/cart_update.php?removep='.$cart_itm["code"].'&amp;return_url='.$current_url.'"&gt;&amp;times;&lt;/a&gt;&lt;/span&gt;';
              echo '&lt;div class="p-price"&gt;'.$currency.$obj-&gt;Price.'&lt;/div&gt;';
              echo '&lt;div class="product-info"&gt;';
              echo '&lt;h3&gt;'.$obj-&gt;Title.' (Code :'.$product_code.')&lt;/h3&gt; ';
              echo '&lt;div class="p-qty"&gt;Qty : '.$cart_itm["qty"].'&lt;/div&gt;';
              echo '&lt;div&gt;'.$obj-&gt;Description.'&lt;/div&gt;';
              echo '&lt;/div&gt;';
              echo '&lt;/li&gt;';
              $subtotal = ($cart_itm["price"]*$cart_itm["qty"]);
              $total = ($total + $subtotal);
  
              echo '&lt;input type="hidden" name="item_name['.$cart_items.']" value="'.$obj-&gt;Title.'" /&gt;';
              echo '&lt;input type="hidden" name="item_code['.$cart_items.']" value="'.$product_code.'" /&gt;';
              echo '&lt;input type="hidden" name="item_desc['.$cart_items.']" value="'.$obj-&gt;Description.'" /&gt;';
              echo '&lt;input type="hidden" name="item_qty['.$cart_items.']" value="'.$cart_itm["qty"].'" /&gt;';
              $cart_items ++;
  
          }
          echo '&lt;/ul&gt;';
          echo '&lt;span class="check-out-txt"&gt;';
          echo '&lt;strong&gt;Total : '.$currency.$total.'&lt;/strong&gt;  ';
                  echo '&lt;input name=\'submit\' type="submit" value="Complete Order" style=\"width:150px;background:#333;color:#ffcc33;height:30px;\" /&gt;';
          echo '&lt;/span&gt;';
          echo '&lt;/form&gt;';
  
      }else{
          echo 'No items added';
      }
  
      ?&gt;
  </code></pre>
  
  <p>Second part:</p>