How do I read a MySQL data with a null field?

Glenn

Member
I have

$pageSource = mysql_query("SELECT * FROM pmkArticles WHERE category = '$directory1'");



I have a field where category is empty and if $directory1 is empty it does not read that field. Why?
 

chrishirst

Well-Known Member
Staff member
Because an "empty" string is not NULL and NULL is not a "empty" string, in the same way that "empty space" does not equate to "Nothing" (with a capital N) to a theoretical physicist, so NULL is a special case of "nothing" to computer programmers.
 
Top