title: Insert data into mysql php in diffrent rows after retrieve from xml file
body: <p><strong>test.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;propertyList&gt;
    &lt;business  type="food"&gt;
    &lt;listingAgent id="1"&gt;
      &lt;name&gt;Spiro Abelas&lt;/name&gt;
      &lt;email&gt;spiro@abelas.com.au&lt;/email&gt;
    &lt;/listingAgent&gt;
   &lt;/business&gt;
   &lt;business  type="food"&gt;
    &lt;listingAgent id="2"&gt;
      &lt;name&gt;andy&lt;/name&gt;
      &lt;email&gt;andy@abelas.com.au&lt;/email&gt;
    &lt;/listingAgent&gt;
   &lt;/business&gt;
  &lt;/propertyList&gt;
  </code></pre>
  
  <p><strong>Php code</strong> Interprets an XML file into an object </p>
  
  <pre><code>&lt;?php
    if (file_exists('test.xml')) {
      $xml = simplexml_load_file('test.xml');
        echo "&lt;pre&gt;";
        print_r($xml);
        echo "&lt;/pre&gt;";
    } else {
       exit('Failed to open test.xml.');
       }
   ?&gt;
  </code></pre>
  
  <p><strong>Output</strong> </p>
  
  <pre><code>     SimpleXMLElement Object
  (
  [business] =&gt; Array
  (
  [0] =&gt; SimpleXMLElement Object
  (
      [@attributes] =&gt; Array
          (
              [type] =&gt; food
          )
      [listingAgent] =&gt; SimpleXMLElement Object
          (
              [@attributes] =&gt; Array
                  (
                      [id] =&gt; 1
                  )
              [name] =&gt; spiro
              [email] =&gt; spiro@abelas.com.au
          )
  )
  [1] =&gt; SimpleXMLElement Object
  (
      [@attributes] =&gt; Array
          (
              [type] =&gt; food
          )
      [listingAgent] =&gt; SimpleXMLElement Object
          (
              [@attributes] =&gt; Array
                  (
                      [id] =&gt; 2
                  )
              [name] =&gt; andy
              [email] =&gt; andy@abelas.com.au
          )
  )))
  </code></pre>
  
  <p><strong>Table structure</strong> </p>
  
  <p><img src="https://i.stack.imgur.com/HFqh0.jpg" alt="enter image description here"></p>
  
  <p><strong>i want to inset data like that into table</strong></p>
  
  <p><img src="https://i.stack.imgur.com/BhPFc.jpg" alt="enter image description here"></p>
  
  <p>but i not getting how to retrieve data from array and insert into multiple rows</p>
  
  <p>so plz guide me how to sort out it</p>