PHP Classes

PHP MySQL Compare Two Tables: Show the differences between tables and columns

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 234 This week: 2All time: 8,099 This week: 96Up
Version License PHP version Categories
mysqlcompare 1.0.0MIT/X Consortium ...5HTML, PHP 5, Databases, Tools
Description 

Author

This package can show the differences between tables and columns.

It can connect to one or two MySQL database servers and compares the structure of their tables.

The class outputs a HTML table showing the differences between the tables of the two databases, as well the differences between the columns of each of the tables that are present in the two databases.

Picture of Janes Oosthuizen
  Performance   Level  
Name: Janes Oosthuizen <contact>
Classes: 1 package by
Country: South Africa South Africa
Age: 38
All time rank: 403623 in South Africa South Africa
Week rank: 106 Up2 in South Africa South Africa Up

Example

<?php
/**
 * Copyright (c) Janes Oosthuizen (hello@janes.co.za)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright (c) Janes Oosthuizen (hello@janes.co.za)
 * @since 1.0.0
 * @license https://opensource.org/licenses/mit-license.php MIT License
 */

include("mysql_compare.php");

$comp = new DatabaseCompare();
$comp->SelectDatabaseOne("database_name_1");
$comp->SelectDatabaseTwo("database_name_2");
$comp->ConnectDatabaseOne("localhost","user","password");
$comp->ConnectDatabaseTwo("localhost","user","password");
$comp->displayMatches = false;
$comp->DoComparison();


  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file LICENSE.txt Lic. License text
Plain text file mysql_compare.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:234
This week:2
All time:8,099
This week:96Up
User Comments (1)
changed to mysqli and works perfectly.
4 years ago (Fred kembo)
70%StarStarStarStar