Re: [chassa2556] What if clauses
Hi Charles,
First you need to determine the name of your uploads variable. Usually it will look something like this: $newsRecord['uploads'] Use your own fieldname in the example code below.
Next, you can use some code like this to test for uploads:
<?php if ($newsRecord['uploads']): ?>
... this html or php will be shown if there are uploads ...
<?php endif ?>
Just wrap those tags around the content you want to show. Make sure the content can be removed without breaking the page design. For example if you put that around half a table and there was no uploads it would only show the bottom html for the table.
Typically you'd put it around a entire table, tr, td, or block of code.
Along the same lines, you can add a ! for "not" to test if there are "not" uploads. Like this:
<?php if (!$newsRecord['uploads']): ?>
Sorry, there are no uploads.
<?php endif ?>
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com