View Full Version : What is your prefered way to deal with users and their preferences?

01-10-2006, 03:55 PM
What is your prefered way to deal with users and their preferences?

Do you rather use true/false, 1/0, yes/no, other...?[/LIST]

How do you store them in the db? in an array? single columns for each pref?

What kind of problems have you encountered so far with a method you've chosen?

I'd just like to learn from your experiences...

01-10-2006, 04:48 PM
i generally use a mix of array values within a single column, and single values in columns.

for things like colour scheme options i store them in an array in a single column (knowing the order i need to pull them in).

for singular things like display names, or birthdays i store them in their own column.

I find this is best because the values you will most likely be using together are stored together. and therefore easier to manage.

01-10-2006, 04:56 PM
I agree with rlemon, I store them in their own fields often with 0/1 as the switch.

also I beleive that "true/false" values are really only for access databases, or maybe MSSQL.

I only use arrays for storing formation like options from multiple checkboxes.


Velox Letum
01-10-2006, 05:49 PM
I use a column per user option...an ENUM('0', '1') if it's a true/false type thing. Otherwise I use as appropriate, such as varchar for a text field, same for multiple checkboxes, I just store a serialize() (http://www.php.net/function.serialize)'d array.

ralph l mayo
01-10-2006, 07:32 PM
The most efficient way to store binary options is generally to use each bit of and INT field. Eg, if you have 4 bit INT (up to 16), you can make each bit stand for show email, show im, show sig, and allow pms.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum