Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2011-01-11 09:18
Size: 1,910 bytes
 

Contents

Class file image Download
<?php
// ======================================================================================================================================================
    //  Author:                     Gustavo Arcila (tavoarcila at gmail dot com)
    //    Web:                         http://www.gurusistemas.com
    //    Name:                         phpMyDBCompare.inc.php
    //     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 www.gurusistemas.com to get more info
    //
// =====================================================================================================================================================

include("phpMyDBCompare.inc.php");

$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();
?>