Display Certain Records

5 posts by 2 authors in: Forums > CMS Builder
Last Post: October 6, 2012   (RSS)

So i have a bunch of records with check boxes, either "Participating Bar" or "Not Participating Bar". How do I show only the records that have the "Participating Bar" checked?

Thanks!

Re: [shawnpatoka] Display Certain Records

Hi,

You can use a get Records function to filter them out fairly easily.

I would do something like this:

list($barRecords, $barMetaData) = getRecords(array(
'tableName' => 'barSection',
'loadUploads' => true,
'allowSearch' => false,
'where' => "participatingBarField = '1'"
));


If you change the names of the field and section in the example above, it should output only bars that are participating.

A tick box value is stored as 1 for ticked and 0 for unticked in CMS Builder.

Thanks
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Display Certain Records

What if I wanted the Participating Bars to be clickable links to their detail page, and the Not Participating Bars to show below the Participating Bars list which will be just a list, not links...

Re: [greg] Display Certain Records

thank you very much, it worked great!