Jump to content

[SOLVED] Cron Job Help


sdevaney

Recommended Posts

I cant figure out why this cron job will not run and no errors display. Any insight is greatly appreciated. Thanks a lot in advance!

 

<?
error_reporting(E_ALL);
ini_set('display_errors', '1');

include ("system/dbconnect.php");

$sth1 = mysql_query("select HeartID, RunEvery, RunTime, ModCode from heartbeat where Enabled = 'Y'") or die ('Error: '.mysql_error ());

while($datab = mysql_fetch_array($sth1))
{
$time = $datab['RunTime'];
$time = $time-1;

if ($time <= 0) 
{
	$runcode = $datab['ModCode'];
	eval($runcode);
	$time = $datab['RunEvery'];
}
$sth2 = mysql_query("update heartbeat set RunTime=$time where HeartID=".$datab['HeartID']."");
}

?>

Link to comment
Share on other sites

$sth1 = mysql_query("select HeartID, RunEvery, RunTime, ModCode from heartbeat where Enabled = 'Y'") or die ('Error: '.mysql_error ());

u have problem in here

you should type

$sth1 = mysql_query("select HeartID, RunEvery, RunTime, ModCode from heartbeat where Enabled like '%Y%'") or die ('Error: '.mysql_error ());

 

Link to comment
Share on other sites

$sth1 = mysql_query("select HeartID, RunEvery, RunTime, ModCode from heartbeat where Enabled = 'Y'") or die ('Error: '.mysql_error ());

u have problem in here

you should type

$sth1 = mysql_query("select HeartID, RunEvery, RunTime, ModCode from heartbeat where Enabled like '%Y%'") or die ('Error: '.mysql_error ());

 

I am afraid that did not fix it. Thank you though.

Link to comment
Share on other sites

OK after doing a little more digging I have found that it runs once but it wont run again and I have it set to run every 5 mins. So does that mean there is a problem with my servers cron daemon or could it be something in my db? I am at a loss here so any information is appreciated. Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.