title: Inserting data into MySQL from a multidimensional array in php
body: <p>An API I am querying returns the following data which I've used json_decode to put into an array.  I need to extract certain values for inserting into a MySQL database.  In the example below (which only has one ID), I want to insert ID = 4229850 and 2011 (the value of the field Vanguard).  I'm can't figure out how to navigate through the array and generate the appropriate insert statement.</p>
  
  <pre><code>Array 
      ( 
      [Contacts] =&gt; Array 
          ( 
          [0] =&gt; Array 
              ( 
              [Id] =&gt; 4229850 [Url] =&gt; https://abc.com 
              [FirstName] =&gt; Mol 
              [LastName] =&gt; Thompson 
              [FieldValues] =&gt; Array 
                  (
                  [0] =&gt; Array 
                      (
                      [FieldName] =&gt; Profile last updated [Value] =&gt; 
                      ) 
                  [1] =&gt; Array 
                      (
                      [FieldName] =&gt; First name [Value] =&gt; Mol 
                      [CustomAccessLevel] =&gt; Public
                      )
                  [2] =&gt; Array 
                      (
                      [FieldName] =&gt; Last name [Value] =&gt; Thompson 
                      )
                  [3] =&gt; Array 
                      (
                      [FieldName] =&gt; e-Mail [Value] =&gt; abc@yahoo.ca
                      )
                  [4] =&gt; Array 
                      (
                      [FieldName] =&gt; Vanguard [Value] =&gt; 2011
                      ) 
                  )
              )
          ) 
      )
  </code></pre>