Hello I currently have this PHP Script
<?php if($purchase_dates != FALSE){?>
<?php foreach($purchase_dates as $id=>$outer_value) { ?>
<!-- Output the date here -->
<!-- Start Purchase table -->
<?
$date = strtotime($outer_value['date_purchased']);
$data = date('F jS Y', $date);
?>
<h3></h3>
<!-- Start inner loop -->
<?php foreach($purchases as $id=>$inner_value) { ?>
<?php if($inner_value['date_purchased'] == $outer_value['date_purchased']) { ?>
<div class="row">
<ul>
<li class="id"><a href="/search/cv/<?=$inner_value['code'];?>"><?=$inner_value['code'];?></a></li>
<li class="name"><a href="/search/cv/<?=$inner_value['code'];?>"><?=$inner_value['firstname'];?> <?=$inner_value['surname'];?></a></li>
<li class="download"><a href="">Download PDF</a></li>
<div class="disp">
<li class="location"><?=$inner_value['city'];?></li>
<li class="status"><?=$job_status[$inner_value['job_status']];?></li>
<li class="education"><?=$education_types[$inner_value['education_level']]['nice_name'];?></li>
<li class="role">
<?php
$out = array();
if($inner_value['is_contract'] == 'Y') $out[]="Contract";
if($inner_value['is_permanent'] == 'Y') $out[]="Permanent";
if($inner_value['is_temporary'] == 'Y') $out[]="Temporary";
echo implode(", ",$out);
?>
</li>
<li class="salary"><?=$salaries[$inner_value['expected_salary_level']]['nice_name'];?></li>
</div>
</ul>
</div>
<?php } ?>
<?php } ?>
<!-- End inner loop -->
<?php } ?>
<?php }?>
<!-- End Outer Tree Loop -->
This generates something that looks like this,
22nd July
Purchase1
22nd July
Purchase 2
18th July
Purchase 3
18th July
Purchase 4
My question is, I want to group all the purchases that are on the same under that date and also if that date is todays date I want to replace '23rd July' with 'Todays Purchases'
I am already using groupby in my SQL