Show results if column = NULL

I'm trying to display results (for a property search in admin).

There's a 'live' column in the database which if  = 1 the property is live, if it's NULL is means the property is part-completed and not live.

I want to display the part-completed properties but can't get the query to work.

Here's what i'm trying:

SELECT properties.propertyID, properties.pricePrefix, images.selected, properties.memberID,, properties.country_code, images.filename,, FORMAT(properties.prices,0) as prices, properties.currency FROM properties INNER JOIN images ON properties.propertyID=images.propertyid WHERE   properties.memberID ='$userid' AND = 'NULL' ORDER by properties.prices ASC

Open in new window

This works fine to display the live properties with = '1' so the query is pretty close. I just can't get it to work with = 'NULL'

Any ideas?database
Who is Participating?
You have quotes around the word NULL, so MySQL is treating it like a string.

The proper syntax is
... where columnName is NULL ...

Open in new window

so you would want
... AND is NULL ...

Open in new window

BrighteyesDesignAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.