Hi I have this code which should change the background colour if the date is 2 months near expiry but for some reason it doesn't work properly. I think it only changes if the year is smaller not the actual date. Any help is appreciated.
my code is:

```
    $expires  = date("Y/m/d",(mktime(0, 0, 0, date("m")+2, date("d"), date("Y"))));
    echo ($expires."<br>");
    $dateDue = date('m/d/Y');

    $result = $db->prepare("SELECT * FROM tblitemdates ORDER BY name ");

    $result->execute();

    for($i=0; $row = $result->fetch(); $i++){

?>

<tr class="record">
<?php

if ($row["dateDue"] == NULL)
echo '<tr style="background-color:#ffffff">';
else if ($row["dateDue"]< $expires)
    echo '<tr style="background-color:#FFCC99">';
else if ($row["st1"] == NULL)
    echo '<tr style="background-color:#ffffff">';
else if ($row["st1"]< $expires)
    echo '<tr style="background-color:#FFCC99">';

  else
  echo '<tr style="background-color:#ffffff">'; ?>

```

regards,
B