SYNATAX HOW TO DISPLAY RESULTS FROM LISTINGS WHERE TWO CONDITIONS MUST EXIST

3 posts by 2 authors in: Forums > CMS Builder
Last Post: September 14, 2016   (RSS)

By Steve99 - September 14, 2016

Hello,

You can do this for your where statement:

// load records from 'listings'
 list($listingsRecords, $listingsMetaData) = getRecords(array(
 'tableName' => 'listings',
 'loadUploads' => true,
 'allowSearch' => true,
 'where'   => '`hide_listing` = "0" AND `content` = "cobourg"',
));

As a side note, I noticed you have that field "hide_listing". If you're looking to hide records there is a built in feature - if you name a checkbox field as "hidden" the CMS will automatically hide those records from showing on the front of your site.

Hope this helps!

Steve

By kitka - September 14, 2016

Steve...
thankyou very much.. it works fine now....

I coudn't remember the correct syntax...thanks again

jim albert