php - Check if information from database is blank -


i need check if status , b blank or 0, blank doesnt work, suggestions?

 $sta = db2_result($queryexe, 'statusa');  $stb = db2_result($queryexe, 'statusb');    if ($sta=="0" or $sta=="" , $stb=="0" or $stb=="") 

you should use empty function consider 0, "0", null... empty values :

if (empty($sta) && empty($stb)) { 

if want stick logic, consider separate if statements in 2 parts :

if (     ($sta=="0" or $sta=="")     ,     ($stb=="0" or $stb=="") ) { 

Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -