ALternatively, it is easy enough to use TBS nice "ondata" capability...
The following alterations to the example you reference are tested.
The php code needs to be altered as follows...
$country_cnt = 1;
$country = "ZZZZ";
$TBS->MergeBlock('blk_res',$result) ;
$TBS->Show() ;
function ev_cnt($BlockName,&$CurrRec,$RecNum){
global $country_cnt;
global $country;
if($CurrRec['country'] != $country){
$CurrRec['country_cnt'] = $country_cnt;
$country_cnt += 1;
}
$country = $CurrRec['country'];
}
|
And the template as follows...
<tr>
<td width="20" bgcolor="#CFE7CF">Country# [blk_res.country_cnt]  </td>
<td colspan="4" bgcolor="#CFE7CF" class="title-section">
[blk_res.country;block=tr;headergrp=country;ondata=ev_cnt]
</td>
</tr> |
Hope that helps a little,
TomH