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 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. 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. 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 Link to comment https://forums.phpfreaks.com/topic/65836-syntax-issue/#findComment-328996 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.