Where clause not working as would be expected

2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 23, 2009   (RSS)

Re: [garyhoffmann] Where clause not working as would be expected

By Chris - October 23, 2009

Hi Gary,

That code looks correct to me. I don't have any ideas other than to simplifying matters to narrow down where the problem is. For example, you could try to hardcode "Friday":

list($sidebarRecords, $sidebarMetaData) = getRecords(array(
'tableName' => 'daily_specials',
'limit' => '1',
'where' => "title= 'Friday' ",
));
$sidebarRecord=$sidebarRecords[0];


Assuming that doesn't work either, you could check your record's title field to make sure it doesn't have a trailing space, incorrect capitalization, or anything else strange.

You could also try using the built-in search feature of a list page to make sure exampleList.php?title=Friday shows your record.

If you still can't figure out what's wrong, let me know.
All the best,
Chris