Re: [Jason] "if" statements for no matching criteria
Hi Jason,
Sorry, but I'm still a bit confused.
It sounds logical, but I tried implementing the code that you suggested and I ended up with blank viewers in both cases.
Here's what I did:
Scenario #1 - checkboxes:
I inserted the code you suggested into my existing code like this:
<?php $ischecked=0; ?><?php foreach ($e_blast_events_noticeRecords as $record): ?><?php if ($record['apbc_event'] == 1): ?> <?php $ischecked=1; /><?php endif; ?>
<?php endforeach; ?><?php echo $ischecked==0 ? "No records found"; ?>
<?php foreach ($e_blast_events_noticeRecords as $record): ?><?php if ($record['apbc_event'] == 1): ?>
my code...
<?php endforeach; ?>
But that resulted in a blank viewer.
I tried to implement the code you recommended for the second scenario into my code like this with the same result.
<?php
list($e_blast_events_noticeRecords, $e_blast_events_noticeMetaData) = getRecords(array(
'tableName' => 'e_blast_events_notice',
'where' => '(NOW() + INTERVAL 7 DAY) >= event_reception_date AND event_reception_date >= TIMESTAMP(CURDATE(), "00:00:00") OR (NOW() + INTERVAL 7 DAY) >= event_start_date AND event_start_date >= TIMESTAMP(CURDATE(), "00:00:00")',
));
?>
<br />
<?php echo count($getRecords)==0 ? "No records found"; ?>
Must be my lack of coding knowledge.
Hope you can shed some light on this.
Thanks again and welcome to the club,
Jerry Kornbluth
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php