PHP Classes

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Gustavo Arcila  >  phpMyDBCompare  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Sample file
Class: phpMyDBCompare
Compare the schema of two MySQL databases
Author: By
Last change: Updated sample
Date: 4 years ago
Size: 1,910 bytes


Class file image Download
// ======================================================================================================================================================
    // Author: Gustavo Arcila (tavoarcila at gmail dot com)
    // Web:
    // Name:
    // Description: Class
    // License: GNU General Public License (GPL)
    // Release Date: May 29th / 2006
    // Last Update date: Jan 11th / 2011 (rewrited)
    // Comments: A very simple tool which will help php developers to compare if their Remote databases are the same as their local databases
    // Sometimes you made changes in your local database but forget to do in your Remote, even more if you use several databases
    // Features:
    // * Easy to use
    // * Local and remote databases may have different names.
    // * If the class find differences between databases, the row containing the differences are painted red
    // Tested on:
    // * php 4.x, php 5x
    // If you make any modifications making it better, please let me know to info at gurusistemas dot com
    // Do you know the powerfull phpMyDataGrid? go to to get more info
// =====================================================================================================================================================


$comp = new DBCompare();
$comp -> SelectLocalDatabase("empresas");
$comp -> SelectRemoteDatabase("empresas"); // Call this only If the remote database has a different name
$comp -> ConectaLocal("localhost","username","password");
$comp -> ConectaRemote("ip_to_remote_server","username","password");
$comp -> displayMatches = true; // set true to display matches as well as differences
$comp -> Compare();