SELECT users from MySQL database by privileges bitmask?
I have users table and want to SELECT some rows by bitmask criteria. I'll try to explain my problem with small example. Structure of table users user_id int [primary key, auto_increment] user_email varchar(200) user_privileges int Note: It has more fields but they are irrelevant for this question. Filled table may look like this +---------+--------------------+-----------------+ | user_id | user_email | user_privileges | << binary +---------+--------------------+-----------------+ | 1 | john@example.com | 165 | 10100101 | 2 | max@example.com | 13 | 00001101 | 3 | trevor@example.com | 33 |