My database has multiple boolean values. After I saved the database, the booleans got converted into tinyint(1). I think this is because it just needs to save 1 or 0.
However, I now have a problem comparing the value in PHP. I saved the tinyint into an array without any code-wise conversion. The array has multiple entries that are text and date and multiple entries with booleans, for example:
array[0] is '09:45:00'
array[1] is '10:45:00'
array[2] is 1
array[3] is 0
array[4] is 0
array[5] is 1
array[6] is 'active'
Now if I loop through the array I want to check if the value is a time, a text, or true/false.
Checking if the entry is true will always return true, because no entry is empty. Checking if the entry is 1 or 0 works for the boolean, but when I check if 'active' == 0 it is returning true. Why is this the case and how can I get a false if I compare a string with a tinyint?
Comparing with === does not work in any case.