File: /var/www/content-sp/cron/sp_master_structure.php
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include 'config.php';
$start_time = microtime(true);
echo "<br> Start time: " . $start_time . " seconds <br>";
$curDate = date('Y-m-d');
$fromDate = '2023-02-14';
# SP structure update which are laste updated
$structreQuery = "REPLACE INTO h7382406836182.wp_aat93akkcv_sp_master_structure SELECT * FROM contentserver_202130.csp_sp_master_structure where (date(added_date)='$curDate' OR date(last_update_on)='$curDate')";
if($live->query($structreQuery)) {
echo "<br>data updated and inserted";
} else {
echo "<br>SP Error -". $live->error;
}
# CSCOLYMPIAD update which are laste updated
$structreOlyQuery = "REPLACE INTO olyComnDB.oly_master_structure SELECT * FROM contentserver_202130.csp_sp_master_structure where (date(added_date)='$curDate' OR date(last_update_on)='$curDate')";
if($live->query($structreOlyQuery)) {
echo "<br>data updated and inserted";
} else {
echo "<br>Oly Error -". $live->error;
}
# SP Master update which are laste updated
$masterQuery = "REPLACE INTO h7382406836182.wp_aat93akkcv_sp_master_category SELECT * FROM contentserver_202130.csp_sp_master_category where (date(added_date)='$curDate' OR date(last_update_on)='$curDate')";
if($live->query($masterQuery)) {
echo "<br>data updated and inserted";
} else {
echo "<br>SP Master Error -". $live->error;
}
# CSCOLYMPIAD structure update which are laste updated
$masterOlyQuery = "REPLACE INTO olyComnDB.oly_masters SELECT master_id, master_name, medium_id, master_description, status, added_date, last_update_on FROM contentserver_202130.csp_sp_master_category where (date(added_date)='$curDate' OR date(last_update_on)='$curDate')";
if($live->query($masterOlyQuery)) {
echo "<br>data updated and inserted";
} else {
echo "<br>Oly Master Error -". $live->error;
}
//Closing the connection
$live->close();