Where checkbox, limit and random play together

3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 23, 2015   (RSS)

Greetings once again,

Quick question - as I've enjoyed way too many holiday cookies and drinks, my brain can't seem to see the obvious answer.

Table of Executives, only ones with the "index" checkbox checked show up on a page, limited to one record in random order.

  list($executiveRecords, $executiveMetaData) = getRecords(array(
    'tableName'   => 'executive',
    'where' => "index = '1'",
    'limit'       => '1',
    'orderBy'     => 'RAND()',
    'loadUploads' => true,
    'allowSearch' => true,
  ));

Thanks for your help as always....

Perfect.   Thank you very much.