Jump to content

XML import to MySQL with PHP


mastubbs

Recommended Posts

Hi all,

 

I've been trying to figure this out for a while now with no luck.

 

I am setting up an online store and my supplier provides a RSS feed (online) to say which products are in stock. I am trying to have this feed populate a mySQL database by a chron job (or equivilent) say every hour or so. The database is actually a oscommerce database so that way i can keep the stock levels for my store up-to-date.

 

Does anyone know how to make a script in php that can do this? Im sure it can be done.

 

Thanks guys.

 

Matt

Link to comment
https://forums.phpfreaks.com/topic/138822-xml-import-to-mysql-with-php/
Share on other sites

If you are going to do it from cron, take a look at perl - it has a lot of useful xml related modules for parsing xml files.

You can run php scripts from the command line, but it probably is better to use perl for that, and I would suggest NOT having your cron job do it through a web interface - involving a http server in the loop of getting data from a flat file to database is not necessary, and it's probably not a good idea from a security standpoint.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.