If statement

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 13, 2016   (RSS)

By tCote - May 13, 2016

Trying to get this line of code to work with a IF statement so it only shows when a record is present. Not sure what I keep doing wrong but cannot get it to work. 

Model produced by <?php echo $listing['manufacture'] ?> for </i> <b><?php echo $listing['produced_for'] ?>

By Damon - May 13, 2016

HI,

It looks like some of your code is missing. Is it suppose to be like this:

Model produced by <?php echo $listing['manufacture'] ?> for </i> <b><?php echo $listing['produced_for'] ?><b/></li>

I'm not sure what variable you want to check for in the IF statement but here is an example if you have a field called product :

<?php if($listing['product']) : ?>
Model produced by <?php echo $listing['manufacture'] ?> for </i> <b><?php echo $listing['produced_for'] ?><b/></li>
<?php endif; ?>

Does this help?

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/