On Sat, 2006-08-26 at 12:41 -0400, tedd wrote: > At 4:51 PM +0100 8/26/06, Alex Turner wrote: > >And to be very pedantic - as null does not have a type then actually > >'x === null' should evaluate to absurdity, but PHP is more pragmatic > >than that ;-) > > That's a very good point. > > While one NULL variable in php can be compared to another NULL > variable and produce true, it's not so in MySQL. > > In MySQL NULL does not equal NULL -- such comparisons produces NULL > and not true. Instead you have to use IS_NULL or NOT NULL to check > for NULL. > > So, it's probably best to get into the habit of using is_null.
I strongly disagree... If I'm writing SQL then I adhere to the language constructs of SQL, if I'm coding in PHP then I adhere to the language constructs of PHP. There is no reason why one should forgo better constructs just because they don't appear in other languages. When in Rome... Oh btw, PHP draws strongly from C, and in C NULL == NULL, and last I checked C predates SQL. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php