Help with $where statement

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

By nmsinc - July 24, 2014

I need to gather records that are with the last 365 days and I'm having some issues with the $where statement - see below.

The current code below fails to produce any records when their are records present!

Any help would be appreciated - nmsinc

$where2 = "":
$where2 = 'remove_record_from_listing = 0';

$where3 = "";
  $monthDay = date('m/d');
  $year = date('Y')-1;
  $oneYearBack = "".$monthDay."/".$year."";
  $where3 = "(createdDate > '".intval($oneYearBack)."')";
  $where3 = "$where2 AND $where3";
   
  
  // load records from 'items_submission'
  list($items_submissionRecords, $items_submissionMetaData) = getRecords(array(
    'tableName'   => 'items_submission',
    'where'       => $where3,
    'loadUploads' => false,
    'allowSearch' => false,
  ));

nmsinc