title: Inserting a multidimensional array into a MySQL Table text field
body: <p>I'd like to insert a multidimensional array into a MySQL Database field so that it can then easily be read from the database at a later date back into an array. What's the best way to achieve this? </p>
  
  <p>I've tried the following to no avail:</p>
  
  <pre><code>$id    = "MXB-487"
  $items = Array(Array("Coffee", "Blend", "500"), Array("Coffee1", "Blend1", "250"));
  $items = implode(",", $items);
  mysqli_query($con,"INSERT INTO carts (id, items) 
  VALUES ($id, $items)");
  
  /*Code that pulls the array from the Database based on id and stores in variable $info*/
  restored_mdarray = explode(",", $info);
  </code></pre>