jenniferG Posted August 20, 2007 Share Posted August 20, 2007 we want to make a decision based upon whether a column is null or not. The columns are date columns and contain '0000-00-00'; Is this the correct syntax? if(column ===NULL){do something;} else {do something else;} Thanks, Nadine Quote Link to comment https://forums.phpfreaks.com/topic/65836-syntax-issue/ Share on other sites More sharing options...
Daniel0 Posted August 20, 2007 Share Posted August 20, 2007 Just check if it's empty. if(empty($whatever)) { echo "It's empty or null"; } else { echo "It isn't empty or null"; } That should do. Quote Link to comment https://forums.phpfreaks.com/topic/65836-syntax-issue/#findComment-328988 Share on other sites More sharing options...
trq Posted August 20, 2007 Share Posted August 20, 2007 If the columns contain '0000-00-00' then it makes sense you'll need to check for that. Also, your best to do this in your query if possible. Quote Link to comment https://forums.phpfreaks.com/topic/65836-syntax-issue/#findComment-328993 Share on other sites More sharing options...
Daniel0 Posted August 20, 2007 Share Posted August 20, 2007 If it contains 0000-00-00 then it isn't null, but I'm not sure what she means. Btw, how come your username says Jennifer, but you sign your post Nadine? o_O Quote Link to comment https://forums.phpfreaks.com/topic/65836-syntax-issue/#findComment-328996 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.