close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

repeat region

Thread began 10/04/2018 9:38 am by Jamie | Last modified 10/04/2018 1:01 pm by Jamie | 55 views | 1 replies


repeat region

Hey Ray

Have got a recordset that is providing the content for a couple of elements on a page.

The rs is

$OfficeLocations = new WA_MySQLi_RS("OfficeLocations",$DBConnection,0);
$OfficeLocations->setQuery("SELECT * FROM service_contents2 WHERE Live = 1 ORDER BY ServicesOrder ASC");

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

$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>Also find us at:</p>
$OfficeLocations->moveFirst(); //return RS to first record

Is it possible to do both with the same recordset or would I need to use 2?



Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...