From: "Adam Williams" <[EMAIL PROTECTED]>
> I need to test a variable to see if it contains a value or not, and if
> not, do something.
[snip]
> if ( !isset($var )
> { echo "do something";}
That's the correct way.
> What I am doing is checking a field in an sql table, and if the field is
> null, empty, etc... then do something. so what is the best way to check
> the field if its null, empty, etc...?
The variable might be set, yet empty, though. So you may want to add
if(!isset($var) || empty($var))
{ echo "do something"; }
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php