Help wth Syntax ...can anyone help...

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

By kitka - October 16, 2016

I am trying to separate some listings from a property management site...

Presently i show the resdential listings that are not hiden and the ones from each location (ie Port Hope /Cobourg etc etc)

i would also like to be able to filter then  by showing only the condo units from this list on separate e page. and maybe just the rental untils excuding the condo unts.

http://www.genedco.com/indexoct15.php


So under the Rental tabs i can THEN show only the condo listings for each town AS WELL
WITH THE SAME CONDITIONS AS I HAVE THERE RIGHT NOW FOR THE RENTAL LSITINGS
ON THE RENTAL LSITINGS THEN I DONT WANT TO INCLUDE THE CONDO OPTIONS


<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
 /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */

 // load viewer library
 $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
 $dirsToCheck = array('/services3/webpages/g/e/genedco.com/public/','','../','../../','../../../');
 foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
 if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }



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


nY SYNTAX IS WRONG....
SO IN EFFECT I WANT THIS for the condo PAGES
'where' => '`hide_listing` = "0" AND `content` = "cobourg"', AND 'property_type' ='condo'",

AND FOR THE REST OF THE PAGES TO SHOW EVERYTHING ELSE THE EXCEPT CONDOS....

SO IF YOU CLICK ON THE RENTALS TAB AND OPTION cOBURG IT WILL EXCLUDE THE CONDOS FROM THOSE LISTINGS.

'
AND I WANT TO SHOW ONLY CONDO LISTINgs FROM THE TABLE TO DISPLAY ONA CONDO ONLY PAGE
Property Type (value): <?php echo $record['property_type'] ?><br/> WITH THE OPTION OF showing Condo only from that list




i AM GETTIng SCREWED UP with THE CORRECT SYNTAX....and the pages cant load then
CAN ANY help PLEASE









<?php header('Conte

jim albert

By Dave - October 19, 2016

Hi kitka, 

The quotes can be tricky, how about this: 

'where' => " `hide_listing` = '0' AND `content` = 'cobourg' AND `property_type` = 'condo' ",

Uses backticks (`) for the field names, single quotes (') for the values, and double quotes (") for the entire string.  With some added whitespace to make it easier to read.

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com