Tablename - Receipt
coupondate name recno
15-04-2015 A 1
15-05-2015 A 1
15-06-2015 A 1
15-07-2015 A 1
15-08-2015 A 1
15-09-2015 A 1
FOR EX - Expected output
Days 15-04 16-04 17-04 18-04 19-04 20-04 21-04.....like wise upto 15-09
A P P P P P P P P
to display all days within selected date.
<?php
$startdate = $_POST['fromdate'];
$enddate = $_POST['todate'];
$start = date('d', strtotime($startdate));
$end=date('d', strtotime($enddate));
?>
<?php for ($x = $start; $x <= $end; $x++) { ?>
<th width="58%"><?php echo $x; ?></th>
<?php } ?>
below code to display P Else NULL
<?php if($row['coupondate'] == $x) { ?>
<td>P</td>
<?php } else { ?>
<td>NULL</td>
Now i cannot understand here how to display P if coupondate matched with $x date..
for ex - coupondate starts from 15-04 and end on 15-09 ok..
now i need to display P below to this customer from 15-04 upto 15-09