title: Extract forex data from xlm with php and simplexml_load_file
body: <pre><code>&lt;?php
  $url = "http://rates.fxcm.com/RatesXML";
  $xml = simplexml_load_file($url);
  print_r($xml);
  ?&gt;
  </code></pre>
  
  <p>This script really works and the output is here:</p>
  
  <p><a href="http://sitoxte.com/test%20mercato/array.php" rel="nofollow">http://sitoxte.com/test%20mercato/array.php</a></p>
  
  <p>But what I want to do is put this data to MySQL tabs, I need some help because I want to store the data each minute. </p>
  
  <p>So i Try:</p>
  
  <p>json-to-mysql</p>
  
  <p>but I think that array in xml variable is not adeguate. </p>
  
  <p>I want create a for cicle</p>
  
  <p>and create 69 table like this:</p>
  
  <pre><code>  table 1 eur/usd 
  id -  Bid - Ask - High - Low - Direction - Last - timestamp
  1
  2
  3
  4...
  and so on 
  </code></pre>
  
  <p>refresh mode is simple and I do in this way whit javascript: </p>
  
  <pre><code>    &lt;script&gt;
  setInterval(function () {}, 3000);
  var myVar=setInterval(function(){myTimer()},10000);
  function myTimer() 
  {
      var d = new Date();
      document.getElementById("demo").innerHTML = d.toLocaleTimeString();
      location.reload();
  }
      &lt;/script&gt;
  </code></pre>
  
  <p>connetion is simple too and is like this:</p>
  
  <pre><code>//Host: 
  $localhost="******";
  //database
   $mioblog=*******;
  //Nome utente: 
  $username=********;
  //Password: 
  $password=*******;
  // connessione a MySQL con l'estensione MySQLi
  $mysqli = new mysqli("$localhost", "$username", "$password", $mioblog);
  // verifica dell'avvenuta connessione
  if (mysqli_connect_errno()) {
  // notifica in caso di errore
  echo "Errore in connessione al DBMS: ".mysqli_connect_error();
  // interruzione delle esecuzioni i caso di errore
  exit();
  }
  else 
  {
  // notifica in caso di connessione attiva
  echo "Connessione avvenuta con successo";
  }
  </code></pre>