if (isset($nullvar)){
echo 'set';
}else{
echo 'unset';
}
Null fields
Started by Lang, Sep 18 2005 01:01 AM
1 reply to this topic
#1
Posted 18 September 2005 - 01:01 AM
If I set a field to NULL what does it return in a query? Or is the variable left unset. So this would work:
#2
Posted 18 September 2005 - 05:23 PM
From what i know, it will count the variable as set.
Try
Try
if($var === NULL){
echo '$var is null';
}
//or
if(empty($var)){
echo '$var is null/empty';
}
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
