WHERE equivalent of "fieldname_keyword" search

5 posts by 2 authors in: Forums > CMS Builder
Last Post: May 22, 2018   (RSS)

By leo - May 18, 2018

Hi Greg,

Did you put quotes for the like statement? For example: where product like "%television%".

Leo - PHP Programmer (in training)
interactivetools.com

By gversion - May 19, 2018

Hi Leo,

Thank you for the message. Does the below now look correct?

  // load records from 'listings'
  list($listingsRecords, $listingsMetaData) = getRecords(array(
    'tableName'   => 'listings',
    'perPage'     => '10',
    'loadUploads' => true,
    'allowSearch' => false,
    'where' => product like "%television%"
  ));

Also, can you please tell me how to write a WHERE clause that works in the same way as the "fieldname_prefix" search type?

Thank you very much for the help!

Regards,

Greg

By leo - May 22, 2018

Hi Greg,

To make it the same as prefix, the where statement should be 'product like "television%"'.

Thanks,

Leo - PHP Programmer (in training)
interactivetools.com

By gversion - May 22, 2018

Thanks, Leo!