Show/hide region if rows contain/don't contain
I have a recordset that returns 2 page types (PgTypeID is the field name).
I have 2 repeat regions on the page, based on the value of the PgTypeID.
The recordset may have 10 records with PgTypeID = 5, but none with PgTypeID=2.
There is a 'show if recordset is empty' behaviour, which obviously works if no records are returned - but how can I do it so that 'if there are no rows where PgTypeID = 2' show 'No pages of this type' ?
What I have so far (simplified):
<?php
$wa_startindex = 0;
while(!$rsPages->atEnd()) {
$wa_startindex = $rsPages->Index;
?>
<?php if ($rsPages->getColumnVal("PgTypeID") <> "2") { ?>
<p>display contents</p>
<?php } ?>
<?php
$rsPages->moveNext();
}
$rsPages->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
Many thanks
Chris