I'm working on a website that manages food. Keeping track of expiration dates and the such.
When a users dashboard loads, it shows a list of the food items they've currently added along with info about them, Brand, Location (Fridge,Pantry,Freezer), and expiration date.
I have the items in a html table, drawing their values from php echos of the rows of a food table I created.
What I want to do is change the text of the expiration date to red when there is about a 3 day difference between the current date and the set expiration date.
Here's my code for putting the values in the table.
<?php
while($rows = mysql_fetch_array($sql2))
{
?>
<tr>
<td><b><?php echo $rows['Name'] ?></td>
<td><b><?php echo $rows['Brand'] ?></td>
<td><b><?php echo $rows['Type'] ?></td>
<td><b><?php echo $rows['Container'] ?></td>
<td><b><?php echo $rows['ExpirationDate'] ?></td>
</tr>
<?php
}
?>
$sql2 holds a query of all the foods owned by the user.
So how would I create a conditional that would make this work out?