On 15 Aug 2003 14:28:56 -0700, [email]sfmnetsys.com[/email] (Steve Fitzgerald) wrote:
>What I'm trying to accomplish is the following:
>
>2003
>
>July
>5- Result
>7- Result
>
>August
>10- Result
>12- Result
i.e. Only print the month header when the month changes.
>Currently what I have is the following:
>
>
>PHP:
>--------------------------------------------------------------------------------
>
>$space = ' ';
> $cur_year= date('Y');
> $result = mysql_query("SELECT DISTINCT i.racedate,r.racename FROM
> crc1.race r, crc1.raceindex i
> WHERE r.raceid = i.race_id AND
>date_format(i.racedate,'%Y') = '$cur_year'");
>
> if (mysql_num_rows($result)>0){
> echo '<b>'.date('Y').'</b><br/><br/>';
$cur_month = '';
> while ($row= mysql_fetch_array($result)){
if (!$cur_month ||
$cur_month != date("F",strtotime($row['racedate'])) {
> echo
>'<b>'.date("F",strtotime($row['racedate'])).'</b>';
> echo '<br/>';
$cur_month != date("F",strtotime($row['racedate']));
}
> echo date("d",strtotime($row['racedate']));echo
>$space;echo $row['racename'];
> echo '<br/><br/>';
> }//end while
> }//end if
>
>--------------------------------------------------------------------------------
--
Andy Hassall (andyandyh.co.uk) icq(5747695) ([url]http://www.andyh.co.uk[/url])
Space: disk usage ysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])