I'm struggling with a PHP Code, and I have no clue how to solve this. I have two columns with timestamps on which I've ordered by desc in my Html table which I'm generating with PHP code.
I need to find out the differences between the 2nd row StateEndTime and the 1st-row StateStarTtime nd so on and display this in a new row/column. The final table should look like this :
ID Type StateStarTtime StateEndTime Min Difference
xxx YYY 03:57 03:59 00:02
xxx ZZZ 03:53 03:55 00:04
xxx ZZZ 03:46 03:49
Below is the PHP code in my index file
<?php while($row = mysqli_fetch_array($search_result)):?>
<tr>
<td align="Center"><?php echo $row['id'];?></td>
<td align="Center"><?php echo $row['Username'];?></td>
<td align="Center"><?php echo $row['StateStarttime'];?></td>
<td align="Center"><?php echo $row['StateEndtime'];?></td>
<?php endwhile;?>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…