I know this question has been asked before, and the best answers seem to be the following:
Best way to save user settings?
However, I have some additional criteria, so I ask this question again, I need to be able to compare 1 user settings with other user settings and quickly get the differences between two users. All user settings will be a boolean
What is the best way to achieve this?
I thought in the following lines: it has a binary number that represents all user settings: for example. 1100011100 .. each bit corresponds to a specific preference
and then either save it as a BINARY type (where can I store 255 bits, that is, 255 preferences settings - is that right?) or hide the binary in int and save it as int (then the choice between INT or BIGINT is INT = 4 * 8 = 32 bits, BIGINT = 8 * 8 = 64 bits)
Thus, I need to have only one additional column in my user table that stores preferences and it is easy to compare preferences between two users by simply taking a binary number
Does anyone have any other ideas on how to do what I'm trying to do, or see the problem in how I'm trying to do something here?
(Note: Databases are not my forte)
source
share