Where XXX but NOT yyy
3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 31, 2016 (RSS)
By Toledoh - May 31, 2016
Hey all,
How do I do this? I'm trying to list all other people that are in the same group...
// load records from 'people'
list($peopleRecords, $peopleMetaData) = getRecords(array(
'tableName' => 'people',
'where' => 'type = '.$peopleRecord['type'] AND 'num =! '.$peopleRecord['num'],
'loadUploads' => true,
'allowSearch' => false,
));
Tim (toledoh.com.au)
By kitsguru - May 31, 2016
If type is text, the value needs to be quoted. Set debugSQL true to see the generated query.
By Toledoh - May 31, 2016
Thanks Jeff. That boosted me enough to get it:
'where' => 'type = '.$peopleRecord['type'].' AND '.'num != '.$peopleRecord['num'],
Tim (toledoh.com.au)