php - MySQL: <>1 works but =0 doesn't -


when send query like

select id private_messages to_id=1 , opened=0 

it doesn't return anything

select id private_messages to_id=1 , opened<>1 

returns results opened=0. opened columns type enum "1" , "0" (default) values. question is, why first query doesn't return anything?

since opened enum, should write:

select id private_messages to_id=1 , opened='0' 

enums set of possible strings. the documentation:

an enum string object value chosen list of permitted values enumerated explicitly in column specification @ table creation time.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -