iIS NOT NULL...

Got a problem with IS NOT NULL in PHPadmin within Cpanel.  I have some address fields that are NULL.  I don't want these in my list, so I'm asking for the ADDRESS field without data to not be output.  That is, WHERE ADDRESS IS NOT NULL.

This does not work in PHPadmin in Cpanel.  There is an anomaly.

How can I fix this?
Curt GustafssonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
It works perfectly here on 3 different servers and 4 different databases.  When you browse that table, does it actually say NULL in those fields?  Blank is not the same as NULL.
0
Curt GustafssonAuthor Commented:
OK, good point.  The field does not display NULL when empty.  

However, when searching for  possible variants such as IS NOT EMPTY, or IS NOT BLANK, it seems the response always defaults to IS NOT NULL, or IS NULL.

Seems we need to take this a bit further.
0
Dave BaldwinFixer of ProblemsCommented:
If it doesn't say NULL, I would use...
WHERE ADDRESS <> ''

Open in new window

It's possible that there are spaces in the field which would still cause it to show up because it is not empty or blank.  Just useless.
0
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Pawan KumarDatabase ExpertCommented:
You can use like this....

WHERE yourcolumn <> '' AND yourcolumn  IS NOT NULL

OR

WHERE LEN(yourcolumn) > 0 /* You need to use the length function. Its performance will be slow from the first one*/
0
Curt GustafssonAuthor Commented:
Have never smoked, and never will.  But if I were cigar user, I'd pass some out to both Dave and Pawan for WHERE ADDRESS <> '' .

Works like a charm!

Thanks.  You made my day!

Curt
1
Pawan KumarDatabase ExpertCommented:
welcome. Glad to help as always. :)

Cheers !!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.