TRUE converts to 1 and FALSE converts to 0 during query parsing, therefore those two values behave exactly like the respective numbers, e.g. TRUE + TRUE = 2 and FALSE is not NULL.
Posted by Victor Porton on September 27 2008 4:38pm
I suggest using "ENUM('on') NULL" for representing boolean values. This should work well with HTML checkboxes, which are submitted like x=on or as nothing (read undef in Perl, what correspond to NULL in SQL).
User Comments
TRUE converts to 1 and FALSE converts to 0 during query parsing, therefore those two values behave exactly like the respective numbers, e.g. TRUE + TRUE = 2 and FALSE is not NULL.
I suggest using "ENUM('on') NULL" for representing boolean values. This should work well with HTML checkboxes, which are submitted like x=on or as nothing (read undef in Perl, what correspond to NULL in SQL).
Add your own comment.