Limit results based on check box option
2 posts by 2 authors in: Forums > CMS Builder
Last Post: November 9, 2012 (RSS)
Help, I'm stuck. I have a field called "applies to", for one of three centres - Brookvale, CP or Little Digs. I am trying to limit the list to only one of the centres, eg. Brookvale
eg. // load records
list($coming_up_eventsRecords, $coming_up_eventsMetaData) = getRecords(array(
'tableName' => 'coming_up_events',
'where' => ' applies_to="Brookvale" ',
));
However, that gives me no results. The code which is supplied from the code generator is this
<h1>Events / News - List Page Viewer</h1>
<?php foreach ($coming_up_eventsRecords as $record): ?>
Record Number: <?php echo $record['num'] ?><br/>
Event Name: <?php echo $record['title'] ?><br/>
Applies to: <?php echo join(', ', getListLabels('coming_up_events', 'applies_to', $record['applies_to'])); ?><br/>
but I have no idea how to only select Brookvale. Any ideas please?
Thanks
eg. // load records
list($coming_up_eventsRecords, $coming_up_eventsMetaData) = getRecords(array(
'tableName' => 'coming_up_events',
'where' => ' applies_to="Brookvale" ',
));
However, that gives me no results. The code which is supplied from the code generator is this
<h1>Events / News - List Page Viewer</h1>
<?php foreach ($coming_up_eventsRecords as $record): ?>
Record Number: <?php echo $record['num'] ?><br/>
Event Name: <?php echo $record['title'] ?><br/>
Applies to: <?php echo join(', ', getListLabels('coming_up_events', 'applies_to', $record['applies_to'])); ?><br/>
but I have no idea how to only select Brookvale. Any ideas please?
Thanks
Re: [degreesnorth] Limit results based on check box option
Hi,
Please could you replace the following code for me and let me know what output you get on the page? Then I will be able to see how your sections are set up.
replace:
with:
thanks!
Please could you replace the following code for me and let me know what output you get on the page? Then I will be able to see how your sections are set up.
replace:
list($coming_up_eventsRecords, $coming_up_eventsMetaData) = getRecords(array(
'tableName' => 'coming_up_events',
'where' => ' applies_to="Brookvale" ',
));
with:
list($coming_up_eventsRecords, $coming_up_eventsMetaData) = getRecords(array(
'tableName' => 'coming_up_events',
'where' => ' applies_to="Brookvale" ',
));
showme(coming_up_eventsRecords[0]);
die();
thanks!
Greg Thomas
PHP Programmer - interactivetools.com
PHP Programmer - interactivetools.com