Menu
It seems like my PHP is only executing the first time through the loop… anyone know what is wrong here?
<script type=”text/javascript”>
var x;
var curtime;
x=0;
while(x<5)
{
<?php
sleep(5);
$curtimedisplay = date(“h:i:s”);
$jobcur = strtotime($curtimedisplay);
$query = “UPDATE jobinstances SET jobstop=’$jobcur’ where id = ‘$id'”;
$result = mysql_query($query)
or die(mysql_error());
?>
curtime = “<?php echo $curtimedisplay; ?>”;
document.getElementById(‘curtime’).innerHTML=curtime;
alert(curtime);
x=x+1;
}
</script>