MySQL Forums
Forum List  »  PHP

LOAD XML bug
Posted by: David kuhnl
Date: March 28, 2009 12:26PM

Hi, I need to import some data in format XML to my mysql DB, So for test I use the example code :

MySQL_Select_DB("xml_test");
$test=MySQL_query("LOAD XML LOCAL INFILE 'xml.xml'
INTO TABLE person
ROWS IDENTIFIED BY '<person>'");

and the xml.xml file is in the same directory as my test script and look like this:
<?xml version="1.0"?>
<list>
<person person_id="1" fname="Pekka" lname="Nousiainen"/>
<person person_id="2" fname="Jonas" lname="Oreland"/>
</list>

I have a table in my DB which is called person and has the same fields as are in the xml file, but it donť import anything, but it also didnt give me any error report.
What's wrong?
Thanks



Edited 1 time(s). Last edit at 03/29/2009 03:31AM by David kuhnl.

Options: ReplyQuote


Subject
Written By
Posted
LOAD XML bug
March 28, 2009 12:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.