sunilpaladugu Posted March 3, 2011 Share Posted March 3, 2011 Hi all I have to maintain synchronization between two databases for that i need the script for the fallowing I have a table in db1.student I have a table in db2.student structure and data of both databases are same Now I need a php script to If I am deleting any of rows of data in db1.student that should be deleted from the db2.student also This is not work with mysql triggers because both databases are residing on different hosts and they don't have 24/7 connection ..... When I get the connection between them I have to run the PHP script Quote Link to comment https://forums.phpfreaks.com/topic/229451-sequence-of-delete-records/ Share on other sites More sharing options...
fenway Posted March 3, 2011 Share Posted March 3, 2011 That's a cron job. Quote Link to comment https://forums.phpfreaks.com/topic/229451-sequence-of-delete-records/#findComment-1182451 Share on other sites More sharing options...
The Little Guy Posted March 5, 2011 Share Posted March 5, 2011 Wouldn't it be best to set up a master and a slave? When you insert/update/delete records, you send the query to the master, it runs the query then sends the same query to the slave. When you select, it grabs it from either the master or the slave, doesn't matter. Quote Link to comment https://forums.phpfreaks.com/topic/229451-sequence-of-delete-records/#findComment-1183136 Share on other sites More sharing options...
fenway Posted March 5, 2011 Share Posted March 5, 2011 Cron jobs are much, much, much more reliable than replication. Quote Link to comment https://forums.phpfreaks.com/topic/229451-sequence-of-delete-records/#findComment-1183248 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.