Muniu
Muniu

Reputation: 187

How to parse XML in PHP, generating dynamic SQL insert statements

I'm attempting to parse an XML file, and generate & insert the element data into a mysql database. Any pointers? The xml document in this case is deep nested and element data contained goes into one table.

Upvotes: 0

Views: 1751

Answers (1)

Ben
Ben

Reputation: 57207

You can start with using a SimpleXML object (really easy).

Here's the documentation: http://php.net/manual/en/book.simplexml.php

Here's a tutorial: http://www.willfitch.com/simplexml-tutorial-part1.html.

Upvotes: 1

Related Questions