Chris
Chris

Reputation: 1929

xml to mysql database

I have a question. Does anyone have a working php script which can parse a XML file to a sql database? I have searched for some scripts and didn't find anything what looks like I can edit it to my needs.

Any help would be great!

Upvotes: 1

Views: 1314

Answers (3)

Rilindo
Rilindo

Reputation: 1796

It is not a PHP solution, but you can extract values from XML directly into mySQL:

http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html

Of course, if this is something you will need to do often, you can always fall back to what bzabhi have said.

Upvotes: 0

Box
Box

Reputation: 2502

Why not write one from scratch? Not that hard.

Upvotes: -1

codaddict
codaddict

Reputation: 454920

Parse the XML using simplexml and extract the data of your interest from the XML file and insert into MySql using functions listed here.

Give it a try. Its not that difficult and you'll learn a lot.

Upvotes: 2

Related Questions