Page 1 of 1
Table(s) data sync PHP+MYSQL
Posted: Wed Mar 17, 2010 12:05 pm
by varwik
Hi All,
I have two data bases , one is resides in production site and which is mysql , I want to syncronize this data base table data(only data ) to a data base which is not used in live environment and use for report module(DBR). The data sync should be realtime and its only changed data should be propagete to the DBR database. DDL functions not required to carring out in the DBR data base.
I am new to PHP but have worked with mysql , i am looking forward some help for a php script.
Thanks a lot any help welcome,
Re: Table(s) data sync PHP+MYSQL
Posted: Wed Mar 17, 2010 2:42 pm
by Christopher
Find out what database extension you have available and then check the manual. It is really just SQL once you know which library to call.
Also, you might want to look into MySQL replication instead.
Re: Table(s) data sync PHP+MYSQL
Posted: Wed Mar 17, 2010 11:18 pm
by varwik
Thanks Christopher for quick response,
It is all mysql i have to start, i am looking for som php code help to identify data differences in given tables and insert/update/delete to second database tables,
Mysql replication is not posible here the first data base is not possible to change the configurations to support replication.
Thanks a lot
Re: Table(s) data sync PHP+MYSQL
Posted: Thu Mar 18, 2010 2:20 am
by Christopher
To compare the data in two different databases you need to SELECT the data and use PHP to compare the fields. You may want to have your application always write to both databases to they both have the same values.
Re: Table(s) data sync PHP+MYSQL
Posted: Thu Mar 18, 2010 2:30 am
by Benjamin
If you require two different databases on separate platforms to remain in sync (in real-time) you'll need to ensure that they are modified together. You can accomplish this through the use of XML requests, with parsers on each side.
Re: Table(s) data sync PHP+MYSQL
Posted: Thu Mar 18, 2010 3:45 am
by Weirdan
Re: Table(s) data sync PHP+MYSQL
Posted: Thu Mar 18, 2010 4:22 am
by varwik
Weirdan,benjamin,Christopher,Thanks for your valuable posts , i am looking for a solution like maatkit.
i am looking it and believe that i can find a solution to it.
Thanks a lot