conditional question

2 posts by 2 authors in: Forums > CMS Builder
Last Post: July 28, 2011   (RSS)

Re: [rez] conditional question

By Jason - July 28, 2011

Hi,

One approach you can take, is to select your event records first and then, based on the results you get back, set a limit for your query to the news table.

For example:

list($eventsRecords, $eventsMetaData) = getRecords(array(
'tableName' => 'events',
'limit' => '2',
));

if ($eventsRecords) {
$newsLimit = 2;
}
else {
$newsLimit = 4;
}

list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'limit' => $newsLimit,
));


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/