Forum Moderators: open

Message Too Old, No Replies

XML to MySQL Database

         

lapinkulta

4:08 pm on Sep 25, 2006 (gmt 0)

10+ Year Member



Hi!

I am trying to download news a website provides for us in xml format and copy this news from the xml file to a mysql database of our own. Is there a ready script doing so or any nice tutorial?

Thanks.
lapinkulta

DrDoc

9:16 pm on Sep 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld! [WebmasterWorld.com]

"ready script", no ... since the XML syntax varies from one document to another.

There are, however different parsers out there. Are you running on a Windows or Linux platform? Do you have any programming knowledge?

I assume we're not talking a one-time XML-to-Database import, right?

lapinkulta

9:45 pm on Sep 28, 2006 (gmt 0)

10+ Year Member



right, it's a news feed. so only new news should be imported to the database, that's why an ID is transmitted as well.

It will be running on a LINUX server.

I do have PHP programming skills, quite fine actually, but I am new to the xml stuff.

What would you recommend?

Greetings,
lapinkulta

DrDoc

10:02 pm on Sep 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would recommend either simply use regular expressions to grab the data you want, or split into manageable chunks ... or start digging into the various built-in XML functions PHP has. They're not extremely intuitive, but they work fairly well.