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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.