Hi, I'm using PHP to parse a XML file and want to add the information into my DB. What I don't want to be doing is keep going back and forth to the DB as it will eventually cause problems with traffic loads. An example of the XML would be: <item> <title>Name</title> <link>URL</link> <desc>Text</desc> </item> <item> <title>Name</title> <link>URL</link> <desc>Text</desc> </item> Code (markup): What I was planning on doing was creating an array for each "item" and within that create another array for each node (title, link, desc), and then finally pass the whole thing into the stored procedure. The only approach I have seen so far is a comma delimited way of doing it and don't think this way is very practical for what I want to do. Does any one have any suggestions on how I could achieve this?
Ok, I may have found another approach. It looks like MySQL can actually read XML files directly using the LOAD_FILE function. Am I right that the file however, needs to be local to the DB? The XML files won't be local but I'm fairly sure there's nothing stopping me saving a copy of it to my local server. I'll give this method a try and let you know the result. Obviously if any one does have any other suggestions I am quite keen to hear them.