estoy usando esto en cron.php
con esto require_once("../cron.php"); y include("../cron.php");
Código PHP:
Ver original$mysqli = new mysqli($DB_HOST,$DB_USER,$DB_PASS,$DB_NAME);
$result = $mysqli->query("SELECT * FROM epg") or
die($mysqli->error); while ($rEPG = $result->fetch_array(MYSQLI_ASSOC)) {
$fecha_update = $rEPG['last_updated'];
$fecha_limit = strtotime("- ".$rEPG['days_keep']." days"); if($fecha_update < $fecha_limit) {
// si se ha superado la fecha de entrega
echo "Ya no tiene garantia";
$mysqli->query("DELETE FROM epg_data WHERE epg_id='".$rEPG['id']."'") or
die($mysqli->error); $mysqli->query("UPDATE epg SET last_updated='$fecha' WHERE id='".$rEPG['id']."'") or
die($mysqli->error); $xml = LoadEpg($rEPG['epg_file']);
foreach ($xml->programme as $item) {
$channel_id = (string) $item->attributes()->channel;
$date_start = date('Y-m-d H:i:s', $start); $date_stop = date('Y-m-d H:i:s', $stop); $list[] = '(\'' . $rEPG['id'] . '\', \'' . $channel_id . '\', \'' . $date_start . '\', \'' . $date_stop . '\', \'' . $title . '\', \'' . $description . '\')';
}
$mysqli->query("INSERT INTO epg_data (epg_id, channel_id, start, end, title, description) VALUES $values") or
die($mysqli->error); }
}
$mysqli->close();
y lo quiere ejecutarlo