I want to change my background color for one of the rows if one value is bigger than the other.
I tried using jQuery to change the color but it changes the color for every row.
Here is my code:
while ($row = mysqli_fetch_assoc($result)) {
echo'<tr>';
echo'<td>'.$row['id'].'</td>';
echo'<td style="width:25%"><a href="calendarevent.php? EventId='.urlencode($row['id']).'">'.$row['date'].'</a></td>';
echo'<td class="starttime">'.$row['start'].'</td>';
echo'<td class="finishtime">'.$row['finish'].'</td>';
echo'<td>'.$row['total'].'</td>';
echo'<td>'.$row['cash'].'</td>';
echo'</tr>';
$start =$row['start'];
$finish = $row['finish'];
if ( $start<$finish ) {
//CHANGE BACK GROUND COLOR FOR finish time to red
}else{
//Keep the color as it was
}
}