title: Get values from jSon array and do sql insert
body: <p>Here is my array;</p>
  
  <pre><code>    $json = '
  {
      "1":{
          "Device_ID":"a9a3346be4375a92",
          "Date":"2012-05-31",
          "Time":"15:22:59",
          "Latitude":"51.4972912",
          "Longitude":"0.1108178"
      },
      "2":{
          "Device_ID":"a9a3346be4375a92",
          "Date":"2012-05-31",
          "Time":"15:52:07",
          "Latitude":"51.4988357",
          "Longitude":"0.1222859"
      }
  }';
  </code></pre>
  
  <p>It's decoded like this: <code>$array = json_decode($json);</code></p>
  
  <p>I am trying to now insert into a database all the $items in the above array; so i would like to store in a single record all the data within 1, and in a second record all the values within 2.</p>
  
  <p>The idea is i will never know the size of the array so it could have 100 $items.</p>
  
  <p>How would this be done?</p>