I need a field where I can set multiple values. I don't want to go ahead with mysql sets. The other way round I can do is say I have multiple categories.
cat 1, cat 2, cat 3....etc. limited to some 20 categories. Assume them as 1 (00001), 2(00010), 4(00100)...etc.
If my post is in 'cat 1' I would add value of 1(00001) in the post table field which is TINYINT. If my post in in 'cat 1' and 'cat 2' I would add value of 3 (00011) in the TINYINT field.
Now I want to get all the posts which are in 'cat 1' I want to query like field='****1' i.e. is just to check if last bit is on.
One more example. Say my post is in 'cat 2' and 'cat 3', I would add the value 6 (00111). Now I want to get all the posts which are in 'cat 2'. I would like to query where field='***1*'.
As above examples I would like to know how to query a integer field based on which bit is on?