Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: bit-fields or set-type
03-01-2007, 07:41 AM #1
- Join Date
- Aug 2006
- Thanked 0 Times in 0 Posts
bit-fields or set-type
I'm trying to manage user privileges. My first thought was to use bit-fields. Something like:
// 1 = READ // 2 = WRITE // 4 = CREATE // 8 = DELETE // Get users whit read,write,create and delete rights: SELECT userID FROM users WHERE privs = 15;
But then I remebered the SET-type (I allways forget about it). Which is the better to use? Personally I think the bit-field is pretty easy to manage, but which has the best performance? My guess is that the SET-type uses a bitfield anyway.... Anyone that knows what's happening behind the scene?