1

I have two tables with same rows and columns one is on my localhost and second is on a remote server.

What I want is that if some one will add any data to my online remote server it should make an entry automatically to my localhost database.

Is there any way to use a trigger or anything else I can do..

2

2 Answers 2

1

You are looking for Replication. Note that you could do it with a FEDERATED table, but that is extremely slow at best, and should not be used because of both reliability & performance reasons.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks wrikken so is there any other way apart from replication...?
Not a reliable one that I know of. You could fiddle about with some custom build udf's, but really, replication is what you want (and can be easily implemented on any VPS or server, but on shared hosting it's probably a no go).
0

You may want to set up a cron job on your server that executes a php script that checks for new rows in your remote database every few minutes and adds them to the local database.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.