Filtering out Certain Records

5 posts by 2 authors in: Forums > CMS Builder
Last Post: September 21, 2010   (RSS)

Hi there, I need to filter out certain records which match:

suppress=1

from the following code, any suggestions on how I would do this?

<?php
$values = getListValues('yachts','destinations',$record['destinations']);
$labels = getListLabels('yachts','destinations',$record['destinations']);
$valuesToLabels = array_combine($values, $labels);
?>
<p class="destinations">Destinations: <br />
<?php $count2=0; ?>
<?php foreach ($valuesToLabels as $value => $label): ?>
<?php echo ($count2==0)? "" : ", " ?>
<a href="/destination.php/<?php echo str_replace(" ","-",strtolower($label."-".$value)); ?>/"><?php echo htmlspecialchars($label); ?></a>
<?php $count2++;?>
<?php endforeach ?>
</p>


Many thanks
Jan

Re: [aquaman] Filtering out Certain Records

By Jason - September 21, 2010

Hi Jan,

In which table would the field suppress appear? Do you need to remove those records from the entire page, or just from this one section of code?

If you could attach your entire .php page, I can take a closer look into the issue for you.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Filtering out Certain Records

Hi Jason,

just need to remove from this section of code only. The feild is in the destination table.

Have attached the page. Code snippet starts on line 96.

The page looks like this:
sailconnections.dreamhosters.com/yacht-type.php/sailing-1/

Im hoping to suppress the Mediterranean link and a few others from the list of yachts.

Many thanks
Jan
Attachments:

yacht-type_002.php 6K

Re: [Jason] Filtering out Certain Records

Perfect, thanks Jason!