Need Help with If Exists for Uploads

3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 27, 2008   (RSS)

Re: [pcolvin] Need Help with If Exists for Uploads

By Dave - October 27, 2008

Hi pcolvin,

You're right, the upload test needs to be within the foreach loop. Try this (change the field name from "uploads" if needed):

<?php foreach ($incidents_newsRecords as $record): ?>

...
<?php if (!$record['uploads']: ?>
No uploads!
<?php else: ?>
there are uploads (add upload display code here)
<?php endif ?>
...

<?php endforeach ?>



<?php endforeach ?>

<?php if (!$incidents_newsRecords): ?>
No records were found!<br/><br/>
<?php endif ?>


Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Need Help with If Exists for Uploads

By pcolvin - October 27, 2008

Works perfectly. Thank you...