Mysql NULL field and php isset?

Mar 12, 2012   //   by phpfreelancer.biz   //   Blog, MySQL Tutorial  //  No Comments

I have data in my mysql fields which are NULL

But in php when getting the data into an array how come I can compare the value of it without first using php’s isset?

$var = null;

if ($var == 123123) // GENERATES ERROR AS DIDN'T CHECK IF IT WAS SET FIRST

The above code will not generate an error, because the variable $var exists.

Leave a comment

Share This Post

RSS Wordpress News