PHP MySQL Sync tool

Sync one or more MySQL databases with 1 conveniant class

DB Sync 1.2 offers fast and easy syncrhonisation between your online database.
You will get every alter or update statement needed for the update, in one array.
So you can decide wich queries are needed for you.

DB Sync 1.2

Synchronise MySQL databases with PHP
Get your (mysql) databases in sync

  • PHP 5.0 Class
  • Input one or more databases
  • Output one array
  • Complete structure synchronisation
  • Easy integration in you application

Buy it!

Through the secure paypal system, you can but this class for just 30€ (VAT incl.)

As soon as we receive confirmation of paypal, we will send you the class via e-mail.


Who made it?

DB Sync is a product of Thisconnect. Thisconnect develops custom web-applications.

How it works?

As a PHP-developer, the best way to see how it works, is showing you. See for yourself how easy it is.
You can get an array of queries, or execute the queries. The array of queries allows you to integrate in your own application, and let the user choose what to execute, and what not.

Important: The class syncs structures, not data. Synchronisation of data is much more complex, since every situation is different.


// init
$dbsync=new MySqlDBSync();

// add sources
$dbsync->AddSource('localhost', 'syncdbsource', 'root', '', '');

// add target
$dbsync->AddTarget('localhost', 'syncdbtarget1', 'root', '', '');
$dbsync->AddTarget('localhost', 'syncdbtarget2', 'root', '', '');

// Return Array of scripts

// Return Array of scripts

The result

A possible resulting array

[0] => Array
[DBName] => Array
[0] => synctarget1

[scripts] => Array
 [0] =>  ALTER TABLE `table1` ADD COLUMN `field2` varchar(255)    ;
 [1] =>  ALTER TABLE `table1` ADD COLUMN `field1` varchar(100)    ;
 [2] =>  ALTER TABLE `table1` DROP  COLUMN `veld1`;
 [3] =>  CREATE TABLE `table2`( 
 		`id` bigint(11) NOT NULL,
 		`field1` varchar(255),
 		UNIQUE KEY `veld3` (`field1`)
 		ENGINE=InnoDB DEFAULT COLLATE=utf8_general_ci;