01.
$rs_detail
=
$db
->query(
'select field_date, sum(...) from detail where .... group by field_date'
);
02.
$old_year_month
=
''
;
03.
while
(
$rs_detail
as
$ro
){
04.
if
(
substr
(
$ro
[
'field_date'
], 0,7)>
$old_year_month
){
05.
if
(
$old_year_month
>
''
){
06.
echo
'</table><div>'
;
07.
}
08.
echo
'<div class=""><table class="">'
;
09.
$old_year_month
=
substr
(
$ro
[
'field_date'
], 0,7);
10.
}
11.
echo
'<tr><td>data</td></tr>'
;
12.
}
13.
echo
'</table><div>'
;