repeat region
Hey Ray
Have got a recordset that is providing the content for a couple of elements on a page.
The rs is
<?php
$OfficeLocations = new WA_MySQLi_RS("OfficeLocations",$DBConnection,0);
$OfficeLocations->setQuery("SELECT * FROM service_contents2 WHERE Live = 1 ORDER BY ServicesOrder ASC");
$OfficeLocations->execute();
?>
The first code block I only want a specific row to be returned using a specific column ServicesID where the value would be 1
The second codeblock is a repeat using the same recordset and I want to only show the code <p>Also find us at:</p> once after the first loop and then not again
<?php
$wa_startindex = 0;
while(!$OfficeLocations->atEnd()) {
$wa_startindex = $OfficeLocations->Index;
?>
<p><strong style="text-transform:uppercase;"><?php echo($OfficeLocations->getColumnVal("ServicesTitle")); ?> -</strong>
<?php if ("".($OfficeLocations->getColumnVal("Address1")) ."" != "") { ?>
<?php echo($OfficeLocations->getColumnVal("Address1")); ?>,
<?php } ?>
<?php if ("".($OfficeLocations->getColumnVal("Address2")) ."" != "") { ?>
<?php echo($OfficeLocations->getColumnVal("Address2")); ?>,
<?php } ?>
<?php if ("".($OfficeLocations->getColumnVal("Town")) ."" != "") { ?>
<?php echo($OfficeLocations->getColumnVal("Town")); ?>,
<?php } ?>
<?php if ("".($OfficeLocations->getColumnVal("County")) ."" != "") { ?>
<?php echo($OfficeLocations->getColumnVal("County")); ?>
<?php } ?>
<?php if ("".($OfficeLocations->getColumnVal("PostCode")) ."" != "") { ?>
<?php echo($OfficeLocations->getColumnVal("PostCode")); ?>
<?php } ?>
</p>
<p>Also find us at:</p>
<?php
$OfficeLocations->moveNext();
}
$OfficeLocations->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>
Is it possible to do both with the same recordset or would I need to use 2?
Thanks
Jamie