Page 1 of 1

Comparing the records from two similar tables in diff DBs

Posted: Mon Aug 17, 2009 4:15 pm
by tomex1
Hi all,
I am trying to compare two similar tables from separate databases to see what field has changed in Database A and update that row in B as well display it to the user on my php page.
I would really appreciate any information you can give me.

Re: Comparing the records from two similar tables in diff DBs

Posted: Mon Aug 17, 2009 6:20 pm
by John Cartwright
Assuming your master database will be the only one being written to, I would approach this at the database level considering synchronizing multiple databases at the application level can be tricky. Take a look at mysql replication.

Re: Comparing the records from two similar tables in diff DBs

Posted: Mon Aug 17, 2009 6:29 pm
by tomex1
Hi John,
I absolutely agree with you. The problem is, the only access I have got to the master database is to just select. That's the reason why I am approaching it from the app level. I have been trying my best with comparing the arrays but I can't just get my head round it. Please have you got any suggestions?

Thanks a lot