where clause not working

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

By Deborah - December 9, 2009 - edited: December 9, 2009

I have two separate viewers on the same page displaying information from two categories. I've done this on another site, but for some reason it's not working for me on this site. I can view the records fine if I remove the "where" clause for either one.

The category field uses a multi-value checkbox.

In the head I have:

<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
require_once "/var/www/vhost/80/p/www.domain.com/domain/lib/viewer_functions.php";
list($calendarRecords1, $calendarMetaData) = getRecords(array(
'tableName' => 'calendar',
'where' => 'category = "Group A - Meetings"',
));
list($calendarRecords2, $calendarMetaData) = getRecords(array(
'tableName' => 'calendar',
'where' =>'category = "Group A - Events"',
));
?>

In the body:

<?php foreach ($calendarRecords1 as $record): ?>blah, blah, blah...<?php endforeach ?>
<?php if (!$calendarRecords1): ?>Display this if no record.<?php endif ?>

<?php foreach ($calendarRecords2 as $record): ?>blah, blah, blah...<?php endforeach ?>
<?php if (!$calendarRecords1): ?>Display this if no record.<?php endif ?>

Instead of displaying the records for the designated category, I'm seeing the "Display this if no record."

Does anyone see anything wrong here? I am baffled.

Deborah

Re: [Deborah] where clause not working

By Donna - December 10, 2009 - edited: December 10, 2009

Hi Deborah,

Glad to hear you got that fixed up. :) Let us know if you run into any other problems!
Donna

--
support@interactivetools.com