How to make a routine of sending certain data from one Mysql database to another

Asked

Viewed 228 times

0

I’m a beginner and enthusiast in web programming.

I try to develop a system that works basically like this: I have a contact log, only running on localhost (PHP and Mysql) - because I need a system that works even when the machine happens to be without internet.

I thought about doing a routine that works, for example, every 10 minutes and that sends only the new data to another database (means to pass to a Mysql DB in a same Webhost). But to avoid the data conflict (e.g., column id), it would send the variables to a PHP form that would pass this data to the second Mysql database.

I was able to find ways to send the Mysql database via email, but nothing that went to another host.

I could do it using PHP, I saw something about Cron Job. Is there anyone north of what I should research and study strictly to develop this code?

  • If I understand correctly you want to save your data on a remote server, you can use JS for this.

  • Basically yes, what can not occur is the duplicate of data and not depend on the browser is open, IE, if now was sent something, within 10 min it takes the content and inserts in the other database, otherwise nothing is done and the routine is repeated (every 10 min). When something new is inserted and the routine runs again, this new data will be sent to the other database (only this new data).

  • You’ll have to use Cron even

  • What is the name of what I have to study in this case? Is it something specific in Cron? In case I would have to do two routines in my script right: One to check if there is new data and one to send, new, right?

  • Mysql itself has a very robust master/slave replication system. And the coolest thing is that it works transparently. Have you researched about?

  • I’d never heard of it, but now that you’ve suggested I’ll do a little research on it then!

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.