SELECT users from MySQL database by privileges bitmask?

前端 未结 2 513
花落未央
花落未央 2020-12-30 00:27

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

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 01:07

    SELECT
        *
    FROM
        users
    WHERE
        (user_privileges & ) = 
    

    being the access level you want to search on (e.g. 1, 5, 9, 130, etc.)

提交回复
热议问题