Currently I'm using Tinyint(1) to indicate Boolean values in my MySQL databases, which I really don't like that. So, how could I store and retrieve Boolean values in my MySQL databases via PHP?
How to use it in WHERE clause and how to assign the value in INSERT, UPDATE queries properly?
When I have it back on PHP, it's TRUE, true, or simply 1, if I'm gonna check that with ===?
Also did you ever had any problem when you migrating from Tinyint(1) to BOOLEAN?
Thanks in advance. :)
Update:
I know that Tinyint(1) is the same as Boolean, however I want to work on Boolean data type instead of Tinyint(1). That's why I'm asking the question.
BOOL, BOOLEANare only synonyms forTINYINT(1)in MySQL.Booleanin my PHP side, instead ofTinyint, that's why I'm asking the question ...truefalsekeywords tointwhen inserting into any int type. I do believe that some forms of prepared statements make this arrangement for you, but if your query is inline, then this is necessary.