Jump to content

Simple yet boggled


apw

Recommended Posts

 

I use a paid hosting account that doesn't allow the use of cron.  I've seen a few

php scripts like black nova traders have a javascript that uses a counter to update

their database like this:

 

?><br>
<center>
<?
// Update counter

$res = $db->Execute("SELECT last_run FROM $dbtables[scheduler] LIMIT 1");
$result = $res->fields;
$mySEC = ($sched_ticks * 60) - (TIME()-$result[last_run]);
?>
  <script language="javascript" type="text/javascript">
   var myi = <?=$mySEC?>;
   setTimeout("rmyx();",1000);

   function rmyx()
    {
     myi = myi - 1;
     if (myi <= 0)
      {
      myi = <? echo ($sched_ticks * 60); echo "\n";?>
      }
     document.getElementById("myx").innerHTML = myi;
     setTimeout("rmyx();",1000);
    }
  </script>
<?
echo "  <b><span id=myx>$mySEC</span></b> $l_footer_until_update <br>\n";
// End update counter

 

now if I could reword this to update my database pfile for the players turns

that would be great ..

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/112656-simple-yet-boggled/#findComment-579063
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.