title: INSERT XML DATA TO SQL FIELD
body: <p>I wrote a function to insert the <code>&lt;IBAN&gt;&lt;/IBAN&gt;</code> and from the XML to MySQL Database. I cannot figure out why, I cant insert the data from there to MySQL.
  This is the code I wrote.</p>
  
  <pre><code>public function test2(){
          $xml = simplexml_load_file('C:\Users\Nihit\Desktop\test.xml') or die ("could not open xml file");
                 // performing sql query
  
              // count xml nodes
          $node = $xml-&gt;xpath("//IBAN/text()");
  
          var_dump($node);
          $num = 0;
  
           $text = $xml-&gt;asXML();
           $sql = "INSERT INTO transfer_packet VALUES(null, null, 0, null, " . $node . " , null, '" . mysql_real_escape_string($text) . "', " . $num . ", 1, 0, NOW(), null);";
  
              $result = mysql_query($sql) or die(mysql_error());
  
              if (!$result){
  
                  var_dump($result);
                  $result = mysql_query("SHOW ERRORS;");
                  var_dump($result);
  
                  }else{
  
               echo 'SUCCESS';
               echo 'updating id...';
  
               $last_id = mysql_insert_id();
  
  
               $result = mysql_query("update transfer_packet set ORIG_ID = " . $last_id . " where ID = " . $last_id .";");
                 }
  
  
  
  
      }
  </code></pre>
  
  <p>The code is written in codeigniter.</p>
  
  <h1>Update (error received)</h1>
  
  <pre><code>Severity: Notice Message : Array to string conversion FIlename : controllers/xmlconverter.php Line Number :368 Unknown column 'Array' in field list' 
  </code></pre>
  
  <p>This is the xml file I used </p>
  
  <pre><code>fkl.fi/teemasivut/sepa/tekninen_dokumentaatio/Dokumentit/… 
  </code></pre>
  
  <p>And of course database does not update with a new row.</p>