PHP Classes

PHP Database Sync: Synchronize tables of different databases with PDO

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 452 All time: 6,121 This week: 204Up
Version License PHP version Categories
db-sync 1.0.0GNU General Publi...5.4PHP 5, Databases, Systems administration
Description Author

This class can Synchronize tables of different databases with PDO.

It can connect to two different databases given to PDO objects queries a given table of the source database to insert its records on the destination database table of the same name.

The class can truncate the destination table to make a complete copy of the origin table, or delete rows first before inserting the updated rows based on its primary key.


Recommendation for a PHP class to sync database
sync database beetween local machine and server

Innovation Award
PHP Programming Innovation award nominee
November 2014
Number 5

Prize: One downloadable copy of Komodo IDE
Database synchronization is a process sometimes used by applications replicate data in databases.

When you are using databases of the same type, database synchronization is often a matter querying the origin database and inserting database records in the destination database.

However, if you need to use databases of different types, some field data type conversion may be necessary.

This class provides a solution to synchronize tables between different databases. It uses PDO to access each database, so it can avoid the need to convert data types.

Manuel Lemos
Picture of Jacob Fogg
  Performance   Level  
Name: Jacob Fogg <contact>
Classes: 7 packages by
Country: United States United States
Age: 42
All time rank: 1070148 in United States United States
Week rank: 97 Up6 in United States United States Up
Innovation award
Innovation award
Nominee: 3x

Winner: 1x

  Files folder image Files  
File Role Description
Files folder imageFogg (1 directory)

  Files folder image Files  /  Fogg  
File Role Description
Files folder imageDb (1 directory)

  Files folder image Files  /  Fogg  /  Db  
File Role Description
Files folder imageSync (2 files)

  Files folder image Files  /  Fogg  /  Db  /  Sync  
File Role Description
  Accessible without login Plain text file example.php Example An example file
  Plain text file Sync.php Class The main class file

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,121
This week:204Up
For more information send a message to info at phpclasses dot org.