working with WHERE clause

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

By kovali - May 3, 2011

Hi,

Situation: news items can be posted into 3 categories: VW News - Audi News - Skoda News

Problem: my customer wants to display only the latest news-item of each category on the frontpage of the website, like:

VW News
Latest VW news article goes here...

Audi News
Latest Audi news article goes here...

Skoda News
Latest Skoda news article goes here...

With the WHERE clause I can filter on 1 category, like:

list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'where' => 'category="Audi"',
'limit' => '1',

This is okay for one category, but how can this be done for all 3 categories ??

Any help appreciated, thanks!

Koen