MySQL: best for true or false, Yes or No, negative or positive
-
hi, I want to have fields in MySQL such as is_administrator, is_active, is_blocked which will be true or false, yes or no, negative or positive, or whatever name you'll use for it.. I would like to ask what's the best field type to use for such requirment? Thanks, Jassim
Technology News @ www.JassimRahma.com
-
hi, I want to have fields in MySQL such as is_administrator, is_active, is_blocked which will be true or false, yes or no, negative or positive, or whatever name you'll use for it.. I would like to ask what's the best field type to use for such requirment? Thanks, Jassim
Technology News @ www.JassimRahma.com
Depends on your version. But I'd suggest bool, bit or tinyint, depending on availability in your version.
Wrong is evil and must be defeated. - Jeff Ello[^]
-
hi, I want to have fields in MySQL such as is_administrator, is_active, is_blocked which will be true or false, yes or no, negative or positive, or whatever name you'll use for it.. I would like to ask what's the best field type to use for such requirment? Thanks, Jassim
Technology News @ www.JassimRahma.com
Jassim Rahma wrote:
I would like to ask what's the best field type to use for such requirment?
What's the reason you're asking? In MySQL[^], TINYINT(1) = BOOLEAN = BIT
A value of zero is considered false. Nonzero values are considered true.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]