title: php insert foreach just the last element
body: <p>I have a little problem here, I try to insert all what I get from the selection but it inserts just the last element</p>
  
  <pre><code>$dom = new DomDocument;
  $dom-&gt;load("ResultatTestSuite.xml");
  
  // retrieve elements by tagname
  /************************************   ******************************/
  $order = $dom-&gt;getElementsByTagName('order');
  foreach($order as $a )
    echo $a-&gt;firstChild-&gt;nodeValue . "&lt;br /&gt;";
  echo "---&lt;br /&gt;";
  
  $status = $dom-&gt;getElementsByTagName('status');
  foreach($status as $b)
    echo $b-&gt;firstChild-&gt;nodeValue . "&lt;br /&gt;";
  echo "---&lt;br /&gt;";
  
  $message = $dom-&gt;getElementsByTagName('message');
  foreach($message as $c)
    echo $c-&gt;firstChild-&gt;nodeValue . "&lt;br /&gt;";
  echo "---&lt;br /&gt;";   
  
  $timeTaken = $dom-&gt;getElementsByTagName('timeTaken');
  foreach($timeTaken as $d)
    echo $d-&gt;firstChild-&gt;nodeValue . "&lt;br /&gt;";
  
  
  /************************************   ******************************/
  // database configuration
  
  $host = "-----";
  $user = "-----";
  $passwd = "----";
  $bdd = "-----";
  
  $connect = mysql_connect($host,$user,$passwd) or die("erreur de connexion au serveur $host");
  mysql_select_db($bdd) or die("erreur de connexion a la base de donnees");
  
  
  $query2 = "INSERT INTO xml VALUES('$a-&gt;textContent','$b-&gt;textContent','$c-&gt;textContent','$d-&gt;textContent')";
  $result2 = mysql_query($query2);
  </code></pre>