What values ​​should be used for the Mysql BOOL field: TRUE / FALSE or 1/0, why?

Will it matter to use FALSE / TRUE or 0/1 for the BOOL / BOOLEAN field in mysql. Which one is better / safer to use?

+7
source share
2 answers

The constants TRUE and FALSE are evaluated at 1 and 0, respectively; therefore there is no difference between using TRUE / FALSE or 1/0.

+11
source

The field types BOOL and BOOLEAN are actually synonyms for TINYINT (1) , so int 0/1 makes the most sense.

+4
source

All Articles