[PHP] How to pass null as value?

2002-09-11 Thread Chuck PUP Payne

I know this may have been asked a thousand times but how do you pass null on
to a page as a value. Let say in a field where you have a yes and no. Null
needs to equal no. Is this more mysql? Can it be done in php?

Chuck Payne
Magi Design and Support


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] How to pass null as value?

2002-09-11 Thread Jon Haworth

Hi Chuck,

 how do you pass null on to a page as a value. 
 Let say in a field where you have a yes and no. 
 Null needs to equal no. 

Pass from where?

If it's a checkbox on a form, just use isset() to test for the existence of
the variable: true means it's ticked, false means it isn't.

If it's from MySQL I'd suggest using an ENUM('y','n') or a TINYINT field
instead, but I suppose you could test for things like empty or zero-length
strings.

Cheers
Jon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php