PHP Classes

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

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 237 All time: 8,067 This week: 38Up
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: 39
All time rank: 403023 in South Africa South Africa
Week rank: 192 Up4 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 (3)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:237
This week:0
All time:8,067
This week:38Up
User Comments (1)
changed to mysqli and works perfectly.
4 years ago (Fred kembo)
70%StarStarStarStar