Probeer iets in de trant van dit. Slechts een richtlijn, de echte implementatie is aan jou. Ik raad je ook aan om {}
. te gebruiken in plaats van endwhile
.
<?php
$last_row = $mysqli_fetch_array($search_result));
while($row = mysqli_fetch_array($search_result)){
//this is pseudocode, you will need to convert to date objects
$timediff = $last_row['StateStarttime'] - $row['StateEndtime'];
?>
<tr>
<td align="Center"><?php echo $row['id'];?></td>
<td align="Center"><?php echo $row['EmpID'];?></td>
<td align="Center"><?php echo $row['Date'];?></td>
<td align="Center"><?php echo $row['Username'];?></td>
<td align="Center"><?php echo $row['Computername'];?></td>
<td align="Center"><?php echo $row['State'];?></td>
<td align="Center"><?php echo $row['MinutesatState'];?></td>
<td align="Center"><?php echo $row['StateStarttime'];?></td>
<td align="Center"><?php echo $row['StateEndtime'];?></td>
<td align="Center"><?php echo $row['Timestamp'];?></td>
// echo $timediff
</tr>
<?php
$last_row = $row;
}?>