Re: [PHP] testing a variable

2003-11-12 Thread Chris Shiflett
--- Adam Williams <[EMAIL PROTECTED]> wrote: > I need to test a variable to see if it contains a value or not, and if > not, do something. My php is a little rusty, so which would be better? This is a good page for understanding how things like isset(), is_null(), and empty() work: http://www.bl

Re: [PHP] testing a variable

2003-11-12 Thread R'twick Niceorgaw
Adam Williams said the following on 11/12/2003 11:37 AM>> Hello, I need to test a variable to see if it contains a value or not, and if not, do something. My php is a little rusty, so which would be better? if ( !$var ) { echo "do something";} or if ( !isset($var ) { echo "do something";} or a

Re: [PHP] testing a variable

2003-11-12 Thread CPT John W. Holmes
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 > nul

RE: [PHP] testing a variable

2003-11-12 Thread Jay Blanchard
[snip] if ( !isset($var ) { echo "do something";} [/snip] self answering questions, gotta' love 'em! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php