BOOLEAN is an alias to TINYINT(1)
Zero is false, anything else is true. Your function will return 0 or 1, which will get transformed into a string--so in PHP you have the strings '0' and '1'... If you need to compare with a zero use ===
after boolean becomes tinyint(1)
Moderators: egami, macek, gesf
-
- php-forum GURU
- Posts: 974
- Joined: Mon Oct 01, 2012 12:32 pm
you can also use bit for boolean values. it's mostly a matter of preference, but if you have multiple boolean fields, they are stored in a single byte (up to 8 of them) rather than requiring a byte each as with tinyint.