Posted by ElGamo on 10/13/82 11:29
How do i get the contents of a XML file into MySQL?
I've got a XML file in the following shape:
<?xml version="1.0" ?>
- <PRODUCTS>
- <PRODUCT>
<PRODUCT>1234</PRODUCT>
<DATE>22-10-2005 14:00:00</DATE>
<PROCODE>109</PROCODE>
<PROTYPE>abc</PROTYPE>
<DESCA>text-foo foo-text</DESCA>
<DESCB>foo-bar foo-bar</DESCB>
</PRODUCT>
- <PRODUCT>
<PRODUCT>5678</PRODUCT>
<DATE>23-10-2005 15:00:00</DATE>
<PROCODE>020</PROCODE>
<PROTYPE>def</PROTYPE>
<DESCA>foo-bar foo-bar</DESCA>
<DESCB>foo-foo bar-bar</DESCB>
</PRODUCT>
</PRODUCTS>
How do I put each part in a MySQL DB so it looks like:
[ROW1] => 1234 || 22-10-2005 14:00:00 || 109 || abc || text-foo
foo-text || foo-bar foo-bar
[ROW2] => 5678 || 23-10-2005 15:00:00 || 020 || def || foo-text
text-bar || foo-foo bar-bar
I found an XML2Array script but that dumps the XML into a 'multi
level' (is that nested?) array. I don't know how to pull that
apart into readable chunks for MySQL.
It would be nice if there is a function or something in PHP that
does XML2MySQL.
Any help is greatly appreciated.
Thanks in advance!
[Back to original message]
|