title: Taking some data from XML file and inputting into sql
body: <p>Im trying to load the following XML url and some data within into my database.</p>
  
  <p><a href="https://zkillboard.com/api/kills/corporationID/98115872/pastSeconds/7200/xml/" rel="nofollow">https://zkillboard.com/api/kills/corporationID/98115872/pastSeconds/7200/xml/</a></p>
  
  <p>i have the following code:</p>
  
  <pre><code>&lt;?php 
  // INCLUDE DB CONNECTION FILE
  include("includes/connect.php");
  // CHANGE THE VALUES HERE
  include("includes/config.php");
  $url = "https://zkillboard.com/api/kills/corporationID/98115872/pastSeconds/7200/xml/";
  // RUN XML DATA READY FOR INSERT
  $xml = simplexml_load_file($url);
  // Loop Through Names
  $insertValues = array();
  $modifiedTS = date('Y-m-d h:i:s');
  foreach ($xml-&gt;result-&gt;rowset[0] as $value)
  {
          //Prepare the values
          $killID = $value['killID'];
          $solarSystemID = mysql_real_escape_string($value['solarSystemID']);
          $killTime = $value['killTime'];
          $moonID = $value['moonID'];
          $allianceName = $value['allianceName'];
          $corporationName = $value['corporationName'];
          $damageTaken = $value['damageTaken'];
  //Create and run ONE INSERT statement (with UPDATE clause)
      $insert = "INSERT INTO `killLog` (killID,solarSystemID,killTime,moonID,allianceName,corporationName,damageTaken,last_modified) VALUES('$killID','$solarSystemID','$killTime','$moonID','$allianceName','$corporationName','$damageTaken','$modifiedTS') ON DUPLICATE KEY UPDATE 
  last_modified = '$modifiedTS'";
  mysql_query($insert) or die(mysql_error());
  };
  ?&gt;
  </code></pre>
  
  <p>but i get the following errors when accessing the PHP file.</p>
  
  <blockquote>
    <p>Warning:
    simplexml_load_file(<a href="https://zkillboard.com/api/kills/corporationID/98115872/pastSeconds/7200/xml/" rel="nofollow">https://zkillboard.com/api/kills/corporationID/98115872/pastSeconds/7200/xml/</a>)
    [function.simplexml-load-file]: failed to open stream: HTTP request
    failed! HTTP/1.1 406 Non-acceptable encoding. Please use gzip or
    deflate in
    /homepages/*****/*****/htdocs/*****/tool/admin/api_killLog.php
    on line 14</p>
    
    <p>Warning: simplexml_load_file() [function.simplexml-load-file]: I/O
    warning : failed to load external entity
    "<a href="https://zkillboard.com/api/kills/corporationID/98115872/pastSeconds/7200/xml/" rel="nofollow">https://zkillboard.com/api/kills/corporationID/98115872/pastSeconds/7200/xml/</a>"
    in
    /homepages/*****/*****/htdocs/*****/tool/admin/api_killLog.php
    on line 14</p>
    
    <p>Warning: Invalid argument supplied for foreach() in
    /*****/*****/htdoc/*****/tool/admin/api_killLog.php on line 19</p>
  </blockquote>
  
  <p>what am i doing wrong??</p>