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) NOT NULL, `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=41 ;
and some data in this table:
(38, '395d5feaf28df01aafe0781a7f34acbe', 'a:3:{s:2:"id";s:1:"2";s:8:"username";s:7:"wanmeng";s:12:"created_time";s:19:"2011-11-18 19:37:33";}', '2011-12-03 14:14:35'), (39, '0e0ca06ed9ad86937f190eb9544ac935', 'a:3:{s:2:"id";s:1:"1";s:8:"username";s:6:"delphi";s:12:"created_time";s:19:"2011-11-18 13:29:40";}', '2011-12-03 14:28:36'), (31, '3cba76b97cf123009632bdaa5a306385', 'a:3:{s:2:"id";s:1:"1";s:8:"username";s:6:"delphi";s:12:"created_time";s:19:"2011-11-18 13:29:40";}', '2011-12-02 15:50:21'), (30, 'fa356333dd3ee8f1b18b8bf0a827e34c', 'a:3:{s:2:"id";s:1:"1";s:8:"username";s:6:"delphi";s:12:"created_time";s:19:"2011-11-18 13:29:40";}', '2011-12-01 15:32:47')
When I execute the query: SELECT * FROM session WHERE token = false, I expect the result to not be returned, but mysql returns the results:
39 0e0ca06ed9ad86937f190eb9544ac935 a:3:{s:2:"id";s:1:"1";s:8:"username";s:6:"delphi";... 2011-12-03 22:28:36 30 fa356333dd3ee8f1b18b8bf0a827e34c a:3:{s:2:"id";s:1:"1";s:8:"username";s:6:"delphi";... 2011-12-01 23:32:47
It seems that the boolean value "false" may correspond to some varchar, but is there any connection between "fa356333dd3ee8f1b18b8bf0a827e34c" and "false", why is this so?