I have a table like this:
CREATE TABLE IF NOT EXISTS `session` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`token` varchar(32) NOT NULL,
`profile` varchar(1000
If you want to compare a boolean with a varchar, MySQL has to do some implicit type conversion. MySQL casts the varchar value to a boolean, checking only the first character.
If the character is a character or number 0, then the string is evaluated to 0, thus False.
If the character is a number different than 0, then the string is evaluted to 1, thus True (and not appearing in your result set)
The only thing to do is not to compare a string with a boolean, because it makes no sense.