<?
// 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);
?>
|