database - Single or multiple rows for a flag? -


on system users can have multiple settings, proper way of storing flags? flags in single row or have multiple rows?

single row be:

user_id       meta_key       meta_value 1             flags          000000 

where 000000 different states of different flags. like, first bit profile visibility, second bit comments moderation, , on.

multiple rows be:

user_id       meta_key       meta_value 1             flag_profile   0 1             flag_comments  0 1             flag_wall      0 [...] 

there many users , flags, , more flags may added in future, having 1 column each flag doesn't seem idea.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -