Hey Cp'ers.
Ik heb een probleem met m'n crons. Me hosting ondersteund geen CronJobs, dus moet het maar met php doen.
Ik heb de volgende code:
PHP
<?php
if(isset($UPDATE_DB)) {
$dbres = mysql_query("SELECT UNIX_TIMESTAMP(`time`) AS `time`,`name` FROM `cron`");
while($x = mysql_fetch_object($dbres))
$update[$x->name] = $x->time;
if(floor($update['hour']/3600) != floor(time()/3600)) {
$dbres = mysql_query("SELECT GET_LOCK('hour_update',0)");
if(mysql_result($dbres,0) == 1) {
$cron_pass = "secretcronpassword";
$times = (floor(time()/3600))-(floor($update['hour']/3600));
$date = $update['hour']+3600*$times;
$date = date("H:i d-m-Y", $date);
for($nr = 1; $nr <= $times; $nr++) {
include("cron_hour.php");
}
mysql_query("UPDATE `cron` SET `time`='{$date}' WHERE `name`='hour'");
mysql_query("SELECT RELEASE_LOCK('hour_update')");
} // Sluit for optie
} // Sluit floor
} // Sluit if $UPDATE_DB
?>
Toon Meer
Maar het probleem is dat dit niet werkt.
- Ik krijg geen error('s).
- Ik heb zelf ook wat geprobeer.
- Ik heb het Artikel gelezen.
Kan iemand me helpen:$?
Heel erg veel bedankt:$!!!