Login   Register  
PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Wayne Philip  >  Yet Another Sync for db (MySQL)  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Test - Execution script
Class: Yet Another Sync for db (MySQL)
Synchronize MySQL databases
Author: By
Last change:
Date: 2 years ago
Size: 1,195 bytes
 

Contents

Class file image Download
<?
// use one of these files per sync session
// set some global defaults
include("sync.class.php");
$pth "/var/www/cttl/yasdb/sync/in/"// ouput file path
// instatiate object
$sync_obj = new __sync();
// set deafualts for sync_obj
$sync_obj->set_debug(1); 
$sync_obj->set_files_path($pth);
$sync_obj->set_date_setting(); 
// A.  Sync test data
    // create output files from source..
        
$sync_obj->set_tables_4_output("localhost","test_master","root","#R00T&.!","t_id_qq"); // last param = "all" for all tables
        
$wc "t_id_qq | (sts = 1)"// WHERE selection 
        
$sync_obj->set_where_select($wc);
        
$dc "t_id_qq | (sts < 1)"// DELETES records not wanted on the syncronised or TARGET table
        
$sync_obj->set_where_delete($dc); 
        
$dc "t_id_qq | (sts > 1)"// DELETES records not wanted on the syncronised or TARGET table
        
$sync_obj->set_where_delete($dc);         
        
$sync_obj->create_sync_output();// create oputput file
    // do sync import / replace
    
$sync_obj->connect_target_do("localhost","test_sysc","root","#R00T&.!"); // syncs sync db
// B Move other data
$ht $sync_obj->get_ht();
echo(
$ht);
?>