I start off with a variable - $cdate,
then state that $cdate = $start
$start = date("01/m/y"); - this forces the first date to be the 1st of every month.
My code then goes through a while loop, after which, the date needs to be incremented by one day -
$cdate += '1';
When I view the result the fist date is 01/11/04 - as I would expect. The rest of the dates however don't hold this format, and r shown as 2 3 4 5 6 15 26 etc. How can I increment the date and maintain the format I require? I've tried numourous ways none of which work.
The while loop looks like this:
while (odbc_fetch_row($result))
{
$AssetName_val = odbc_result($result, "AssetName");
$ReleaseNo_val = odbc_result($result, "ReleaseNo");
$PredictedReleaseDate_val = '10';
$StatusId_val = odbc_result($result, "StatusId");
if ($AssetName_val != $Last_Asset)
{
$Display_block .= "<tr><td bgcolor=\"#666666\" col width=100>$AssetName_val</td></tr>";
$Last_Asset = $AssetName_val;
}
$cdate=$start;
while ($cdate <= $this_month_daycount)
{
$Display_block .= "<td>$cdate</td>";
if (($PredictedReleaseDate_val == $cdate) && ($ReleaseNo_val != $Last_ReleaseNo))
{
$Display_block .= "<td bgcolor=\"#99FF00\"><FONT color=#000000>$ReleaseNo_val</FONT></td>";
$Last_ReleaseNo = $ReleaseNo_val;
}
$cdate += '1';
}
$Display_block .= "</tr>";
}
$Display_block .= "</TABLE>";
}