0

Hi there,

I am thinking about the best way, how to update my records in database (MySQL) from XML feed. I have database and this database contains the daily offers from several sales portals.
So now - about midnight I am deleting all records from my table and with using script I am downloading new offers from portal (by their XML feeds). This way have one disadvantage -- the time interval among deleting old and inserting new records is ca 5 minutes -- and through this 5 minutes is table empty.

And I would like to ask you, if you could help me with some better way, how updating records in my table using better way...


Thanks a lot for your time!

Best,
Manny

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by blocblue
0

If you add a datetime and status field to your table, you could modify your script to only display offers with a status of active.

At midnight, retrieve all the new offers as you are now, but instead of deleting the existing offers, insert these new offers alongside them, but with a status of inactive.

When the script has finished importing all of the new offers, run a query to update all new offers that were created today to active, and all the old offers created before today to inactive. Thus, the site isn't without offers being displayed.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.