<?xml version="1.0"?>
<resultset statement="SELECT * FROM test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<field name="item">2424</field>
<field name="header">blah blah 1</field>
<field name="text" xsi:nil="true" />
...
</row>
<row>
<field name="item">5321</field>
<field name="header">blah blah 2</field>
<field name="text">some text</field>
...
</row>
</resultset>
My export to xml from mysql looks like above and contains much more fields than needed for the import.
My problem is how to loop through the rows with simplexml in php and only select only some specific fields/names and preserve the datatype (string, null etc.) and format a mysql query ie.:
INSERT INTO table (item, header, text) VALUES ('2424', 'blah blah 1', NULL);
INSERT INTO table (item, header, text) VALUES ('5321', 'blah blah 2', 'some text');
LOAD DATA INFILE
? – Gordon♦ Feb 12 '12 at 12:39