display content only if the column is NULL

Posted on 2012-09-04
Last Modified: 2012-09-04
I need to show content if the live column is NULL. I can do this the other way (as below) but can figure out how to display content only if the live column is NULL

Any ideas?

    <?php if(!empty($row_propertyInfo['live'])): ?>
content to show if NULL

<?php endif; ?>

Open in new window

Question by:BrighteyesDesign
    LVL 12

    Accepted Solution

    I would look at this the other way around.  If a property is live, then the value is 1, right?  So how about
    <?php if ($row_propertyInfo['live'] != 1): ?>
    <?php endif; ?>

    Open in new window

    LVL 49

    Expert Comment

    by:Julian Hansen
    I must be missing somethign - why can't you do this
    if(empty($row_propertyInfo['live'])): ?>
    content to show if NULL
    <?php endif; ?>

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now