Farcell
Member
Hi there, I've setup a custom php cron script which should add records from one table into another, provided the conditions are true. But when I run the cron from schedule, I get a blank page and nothing is recorded. I've added 'error_reporting(E_ALL);' in my script to see what the problem
I've also referenced the customer table in schedule and pointed to this PHP script file. Any help or guidance here will be much appreciated.
Also, how can I update the "customer___Status" after the record is copied over to "2".
PHP:
<?php
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
error_reporting(E_ALL);
$data = $listModel->getData();
$db = FabrikWorker::getDbo();
$TrackingNo = (".$data->customer___id_raw.",".$data->customer___Cargo.");
$Status1 = "We are preparing to ship your cargo and we will update you soon";
$count = (int) $db->loadResult();
if ($count === 0 & $data->customer___Status == "1") {
$db->setQuery("INSERT INTO Tracking (`tracking___tracking_no`, `tracking___status`, 'tracking___date') VALUES ($TrackingNo, $Status1,(DATE_FORMAT(NOW(),'%d-%M-%Y')");
$db->execute();
}
exit;
?>
I've also referenced the customer table in schedule and pointed to this PHP script file. Any help or guidance here will be much appreciated.
Also, how can I update the "customer___Status" after the record is copied over to "2".