patrickstrijdonck
Programmer
Hello all,
I want to make a cron job, that selects all records from a table, Looks if the Date is longer then 23 months ago (ex. Record 1 = date; 16-4-2009 | Record 2 = date; 16-4-2004, Cronjob must select record 2 (and all other records with a date longer then 23 months) and update a field in all records)
I dont know how to do that, but what i have for the update field part, is this
If someone would help me with this, would be great.
Ty in advance
I want to make a cron job, that selects all records from a table, Looks if the Date is longer then 23 months ago (ex. Record 1 = date; 16-4-2009 | Record 2 = date; 16-4-2004, Cronjob must select record 2 (and all other records with a date longer then 23 months) and update a field in all records)
I dont know how to do that, but what i have for the update field part, is this
Code:
$now = date("Y-m-d");
if ( $cursustijd == "0000-00-00" ) {
?>
<span class="style3">Outdated!</span><br>
<?
} else {
// USAGE OF DateComp:
$sDBDate = '2007-10-15 23:16:28';
$sCurrDate = gmdate('Y-m-d');
if (DateComp($cursustijd, $sCurrDate, '- 100 weeks')) {
?>
<span class="style3">Outdated!</span><br>
<?
} else {
?>
<span class="style4">Updated!</span><br>
<?
}
}}
?>
If someone would help me with this, would be great.
Ty in advance