How to update remote MySql with new entries from local database?
Posted on 2007-07-25
Hello, I have a mysql database on remote server and the same database on local server. On every 5 minutes the local database is updated with new entries. New entries are coming from rss feeds.
Until now I used crappy way with php script to update remote database, when processing rss feeds:
"INSERT INTO news (src,cat,title,text,url,img,date) VALUES ('$src','$cat','$title','$text','$url','$img','$date') ON duplicate KEY UPDATE url=url"
This sends all entries from RSS feed, but some feeds are with 100 entries, so each time, i send 100 INSERT queries, but actually new are only a few. The remote database rejects them, because there is DUPLICATE for url.
I want to update remote database, but with minimal server loading on remote server, with sending only a new data. Can you advise me how to do that.
Thank you very much. Sorry for rough english. I have limited mysql knowledge.