Hi,
it would be nice to know how to query mysql for a permission directly.
I'm planning to store 5 different permissions (true or false) for each in one field as a binary number
1 = ( 1 base 10) = permission #1
10 = ( 2 base 10) = permission #2
100= ( 4 base 10) = ..
1000=(8 base 10)= ..
10000=16 base 10 = permission #5
but i would store it in a field ranging in value from 0 to 32, or in base 2 from
00000
to
11111
my question is, how using mysql do I get this equivalent?
"SELECT FROM permissions_table WHERE HAS_PRIVILEGE(permission_field, 8 /* permission#4 */)"
I am pretty sure this is possible but it's been maybe a year since I've seen an example.
Samuel